Efficient way to repopulate item array


What is the most efficient way to repopulate the item array in a node? According to the documentation, I think the suggested approach is to remove the old items one by one and add the new items one by one.

Is there any more efficient approach? For example, is there a command to wipe out the array content at once?


Sure, just replace the Panel.itemArray. It’s probably data bound, so you could do that by calling Model.set on that Array property of the node data object.

However, if you just have a few inserts or removals from a long Array, it would indeed be faster to call Model.insertArrayItem or Model.removeArrayItem.

Thank you, Walter!