PDA

View Full Version : treepanel checkchange on AsyncTreeNode



smokeman
27 Aug 2010, 9:04 AM
I submitted a premium help post yesterday, but no-one is manning that, so I'm posting here too:
I have a treepanel in an app, with a root defined as :

var satreeroot = new Ext.tree.AsyncTreeNode({
id:'satreeroot',
text:'auditees',
cls:'croot',
listeners: {
checkchange: function(node, checked){
console.log('changed');
//if(checked){
///node.getUI().addClass('selected');
//}else{
//node.getUI().removeClass('selected');
//}
selNodes = satree.getChecked();
console.log(selNodes);
}
},
loader:new Ext.tree.TreeLoader({
dataUrl:'jsonagencies.php?type=SA',
uiProviders:{
'col': Ext.tree.ColumnNodeUI
}
})
});

I couldn't get the checkchange listener to fire, so I copied this definition into the check-tree.js example, only commenting out root, and replacing it with the above, and root:satreeroot,

and it doesn't work on the example either.
ext-3.2.1 is the codeversion I'm working from.
in the example, the listener is on the root(defined in the root definition),
but asynctreenode also has a listener for checkchange, why would it not be firing?

I linked to an example here:
http://arklegaudit.gov/test/sachecktree.html

it takes a sec for the list to load, but the checkchange should be firing a console.log

smokeman
30 Aug 2010, 5:23 AM
uhh, nevermind! this listener goes on treepanel, not on the node!