We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change items in Diagram palette and it's performance


I tried to filter items by className property in a diagram pallet and this works fine:

//get old palletes
var palettes = $(divName).ejSymbolPalette("instance").model.palettes;

//filter palettes
var newPalettes = palettes.map(function
(palette) {
palette.
items = palette.items.filter(function
(item) {
return item.className != className
;
});
return
palette;
});
//assing new palettes to diagram
$(divName).ejSymbolPalette
({
palettes:
newPalettes
});

Could you explain how to add (or remove) one (or several) items to Diagram palette without modifying whole array of items? (it seems have problem with rendering perfomance with huge number of items).

And related question: what's better way to add a large number of items to palette (in terms of performance)?








1 Reply

SG Shyam G Syncfusion Team October 21, 2016 12:19 PM UTC

Hi Alexey, 
 
Query 
Response 
Could you explain how to add (or remove) one (or several) items to Diagram palette without modifying whole array of items? (it seems have problem with rendering performance with huge number of items). 
We considered this “Need to provide support to add/remove items from symbol palette” as an usability feature and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
 
 
And related question: what's better way to add a large number of items to palette (in terms of performance)? 
You can add the large number of  palette Items at initial rendering or you can define empty palette at the initial rendering and use updatePalette method to render the palette at runtime. Both use case took same time to render the palette items. Please refer to the sample below in which we have shown how to update the palette items at runtime.  
 
 
 
 
Regards, 
Shyam G 


Loader.
Up arrow icon