PDA

View Full Version : Reload a nestedlist ajax item



nanotron
7 Oct 2010, 8:53 AM
Hello,

is there a possibility to reload the active nestedlist item on cardswitch?

Best regards

evant
7 Oct 2010, 2:01 PM
Try this:



var active = nestedList.getActiveItem();
node = active.recordNode,
treeStore = node.getOwnerTree().treeStore;

treeStore.load({
node: node
});

nanotron
11 Oct 2010, 3:06 AM
Perfect. Thanks.

mherger
11 Oct 2010, 6:15 AM
As this might be related to one aspect of my question (http://www.sencha.com/forum/showthread.php?111945-NestedList-how-to-free-data-memory): is there a way to mark a node "dirty", so that it would be freed when backing out? And always be reloaded?

nanotron
11 Oct 2010, 8:19 AM
Hi,

you could give your records an attribute alwaysLoad and then:


this.on('beforecardswitch', function(list, newCard){
var load = newCard.recordNode.attributes.record.data.alwaysLoad,
loaded = newCard.recordNode.loaded;
if(loaded && load){
var node = newCard.recordNode,
treeStore = node.getOwnerTree().treeStore;
treeStore.load({
node: node
});
}
}
}, this);


Hope this helps.

Regards