View Full Version : Modify a List after rendering?

7 Jul 2010, 12:06 PM
I am trying to add items to a NestedList after it is rendered. The idea is that I want to get my list items from a store and in the 'datachanged' callback, I get the items, add to the list and call doLayout.

But it seems so far, the list will not redraw with updates to its items after rendering.

Is there another trick to try here?


7 Jul 2010, 1:17 PM
You can always read the source code to figure out what you need to do. Internally NestedList creates a Container with the items and assigns it to activeItem property of the Nested List. So you need to add your items to this Container, not to your instance of NestedList.

var list = new Ext.NestedList({...});
list.getActiveItem().add(<your items here>);

7 Jul 2010, 1:48 PM
Good point. Thanks.