


Hi you all,
I want to be able to read the checked / unchecked status of the leaf nodes and also change their checked status when the dialog is opened up or before the root / folder is expanded. I have unable to do this so far. Please see the code I'm using below. The relevant section is in the beforeexpandnode listener.
new CQ.Ext.tree.TreePanel({ border:false, loader: { dataUrl:CQ.HTTP.externalize("path to servlet"), requestMethod:"POST", // request params baseParams: { }, baseAttrs: { singleClickExpand:true //iconCls:"folder" } }, root: { text:"abcd", name:"xyz", id:"xyz", expanded:false }, listeners: { checkchange : function(n , isChecked) { alert(isChecked); }, beforeexpandnode : function(n, a, c){ var sizes = n.childNodes.length; for(i=0;i<sizes;i++){ //n.childNodes[i].getUI().toggleCheck(true); -> doesn't do anything //n.childNodes[i].checked = true; -> doesn't do anything alert(n.childNodes[i].getUI().isChecked()); -> always returns false irrespective of the json returned } }, } });
JSON returned from the servlet:
[{"text":"MenuOption0","leaf":true,"checked":true},{"text":"MenuOption2","leaf":true},{"text":"MenuOption3","leaf":true}]
The treepanel is getting populated correctly. The checkchange event is also being fired when the checkbox on the nodes is checked / unchecked.
The intention is that once the author checks on a node, closes the dialog and opens it again, the same node should remain checked.
Thanks.
Views
Replies
Sign in to like this content
Total Likes