Closed JakeSummers closed 10 years ago
In your sample code it is not clear what type of object treeElement
is or how you acquired it.
Assuming treeElement
is an instance of TreeNode you could simple change the checked state by calling:
treeElement.set("checked", false);
or, using the model:
tree.model.setChecked(treeElement.item, false);
Notice that when calling the model setChecked()
the store item associated with the TreeNode
is used as the first argument, not the tree node itself.
Hi,
Is there a way to programmatically set the state of checked elements?
The workflow that I would like to do is something like the following:
I tried the following:
This prints:
The issue is that it doesn't change the state of the checkbox that is displayed to the user. Before running this code the checkbox is checked. After this is run the checkbox is still set.
Any hints on how to do this would be appreciated.
Thanks, Jake