PDA

View Full Version : Differentiate tree expand event initiator



hbopuri
8 Jan 2015, 12:55 PM
is it possible to do the below?


onTreeNodeExpand: function (node) {
if(this Expand fired from real UI tree expand Icon click){
Do this;
}
else if(this Expand is from your JS code, some one called node.expand()){
Now do this;
}
}

lumberjack
12 Jan 2015, 2:01 PM
You could add an event listener to the treepanel for the expandnode event. Within the handler capture the Ext.EventObject and inspect it to see if a target is specified. If one is available, it's likely that the expand was triggered by a user action. If not, it's a programmatic expand.

Regards,
Brian

lumberjack
12 Jan 2015, 2:02 PM
Here's a fiddle that demonstrates this usage.

Regards,
Brian

g99