I have a Panel that starts with an empty items collection. During the course of the application, it becomes necessary to add an GridPanel to the Panel. This appears to work fine.
At some other point in the application, it becomes necessary to remove the GridPanel, and add another one. I have tried several methods to clear the Panels contents, but with no joy.
Iterating through the items collection and called disable() doesn’t work.
Calling items.removeAt(index) doesn’t work.
Calling removeAll(true) doesn’t work.
The grid stays there and is visible, still throwing all the same events. If I go through my load grid procedure, only one grid is displayed. But the requirements of the application are such that the grid should be cleared when there is a change in the criteria for the data that filled the grid.
I believe I have solved my issue.
Calling
remove(itemName, true)seems to be the trick.Though I would be curious to any that could offer insight as to why
removeAll(true)doesn’t work.