Nov 15, 2012, 1:10 AM
[CLOSED] TreePanel Node Check Through Javascript
Hello
I am working with the TreePanel and trying to "uncheck" a node via javascript when a certain event happens but I cannot find a way to do it.
I have tried the following:
lastCheckedNode.data.checked = false;
lastCheckedNode.raw.checked = true;
lastCheckedNode.attributes.checked = false;
On the CheckChange event of the TreePanel I have the following listener. When the function is called it keeps track of the last node that was checked or unchecked so that if a different node is checked it will uncheck the previous node.
Thank you for your help.
I am working with the TreePanel and trying to "uncheck" a node via javascript when a certain event happens but I cannot find a way to do it.
I have tried the following:
lastCheckedNode.data.checked = false;
lastCheckedNode.raw.checked = true;
lastCheckedNode.attributes.checked = false;
On the CheckChange event of the TreePanel I have the following listener. When the function is called it keeps track of the last node that was checked or unchecked so that if a different node is checked it will uncheck the previous node.
<Listeners>
<CheckChange Handler="TreeItemChecked(item)" />
</Listeners>
var lastCheckedNode = null;
function TreeItemChecked(item) {
if (lastCheckedNode != null && lastCheckedNode != item) {
// uncheck the last node that was passed into this function
// how?
// lastCheckedNode.checked = true; // doesn't work
}
lastCheckedNode = item;
// do other stuff
}
There is reference to a toggleCheck() method of the TreeNodeUI in the Sencha docs but it does not appear to be exposed.Thank you for your help.
Last edited by Daniil; Nov 15, 2012 at 3:41 PM.
Reason: [CLOSED]