PDA

View Full Version : Tree's with checkboxes - please help me clarify



mattwoberts
2 Nov 2007, 12:59 AM
Hi!

I need a tree with checkboxes, and some way of returning a list of checked nodes. There is an forum post where someone has written an extension to do this, but its a little old and based on ExtJS 1.0. Some of the more recent replies suggest that the tree now supports checkboxes out of the box - is this the case and if so was it introduced in 1.1 or 2.0?

If it does support checboxes, can anyone tell me how to enable them and also how to get the selected nodes?

Many thanks :)

mattwoberts
2 Nov 2007, 5:14 AM
Aha, I seem to have found the answer myself. By setting "checked:true" or "checked:false" in the JSON that feeds the tree, this makes ExtJS render the checkboxes for you :)
You can additionally get the selected nodes with this code: tree.getChecked()

It does this from version 1.1 of ExtJS, which makes me very happy :)