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)?