changing the checked status of a TreeNode using code
changing the checked status of a TreeNode using code
I could not find anything about this on the forum os anywhere else.
I have a tree with checkboxes set using the 'checked' property of each node.
I use the id of the TreeNode to create checkboxes with the same id in order to display a list of all selected items in the tree. When a user toggles the TreeNode, my code adds or removes a corresponding checkbox.
I have a function, see code below, attached to the checkboxes, that fires on the status change of a checkbox.
The functions get the appropriate parameters and I can access the TreeNode attributes in the function and they get applied instantly. I cannot find a method to access the the 'checked' property.
Or is changing the checked status not possible using code ?
** Solved it ** See changes to code in comments.
function reportSelectionRemoved(checkboxId, status)
{
treeNodeId = checkboxId.id;
root = Ext.getCmp('customerFilterTree').root;
treeNode = root.findChild('id', treeNodeId, true);
/* change the appearance */
treeNode.ui.toggleCheck(false);
/* change the property */
treeNode.attributes.checked = false;
if(status === false)
{
checkboxId.destroy();
}
}
Last edited by MacUnix; 30 Sep 2010 at 11:55 PM.
Reason: Solved