View Full Version : Tree with checkbox

13 Oct 2010, 11:20 AM
Hi guys, I need to put a checkbox on nodes of my tree.
I found nothing about this.
I am using treeLoader.
Would someone have an example?

13 Oct 2010, 11:25 AM
Simply adding checked:false or true to the node attributes is enough.

13 Oct 2010, 11:30 AM
Is that I am not using treeNode.
Would have some form to make with treePanel or treeLoader?

13 Oct 2010, 11:58 AM
So you don't want to specify checking in your node attributes?

How about specifying baseAttrs:{checked:false} in the treeloader config?

13 Oct 2010, 12:32 PM
Sorry Cordon, I didn't understand what you said.
Did you say for I use baseAttrs="{checked:false}"?
I tried to use it now and It wasn't work.

13 Oct 2010, 10:40 PM
No, no quotes, e.g.

var tree = new Ext.tree.TreePanel({
loader: new Ext.tree.TreeLoader({
url: '...',
baseAttrs: {checked: false},
preloadChildren: true

14 Oct 2010, 6:56 AM
It was work here Condor.
But it appears checkbox on folders.
I need to appear checkbox only on files.
Do you know how do it?

15 Oct 2010, 4:03 AM
loader: Ext.tree.TreeLoader({
url: '...',
createNode: function(attr){
if (attr.leaf) {
attr.checked = false;
this.constructor.prototype.createNode.call(this, attr);