PDA

View Full Version : Trees lack of usability



steffenk
2 Nov 2010, 2:31 PM
Hi,

i think the checkbox integration is incomplete and result in usability problems.

First one styling issue: the property useArrows disables the lines, the lines setting has no more effect.

Now, for example i use the checkboxes for selecting nodes.
First there is a missing "beforecheck" event giving the possibility to cancel check, depending on app logic.
Then the tree has a selectionmodel which can't be disabled, and there is no checkbox selection model. So you can select a row, but it isnt checked. A double click checks the node, but if not leaf, it also collapse/expand. This means two actions with one mouse action.

From my understanding the CheckboxSelectionModel is for grids only. do i miss something?

Condor
3 Nov 2010, 1:39 AM
1. useArrows and lines only influence the class assigned to the master element. If you want arrows and lines you only need to change some css rules.

2. If you want to do stuff before the node is checked then I would recommend overriding the toggleCheck method of TreeNodeUI.

3. You can disable the selection model, the same way disableSelection in GridView works:

selModel: new Ext.tree.DefaultSelectionModel({
select: Ext.emptyFn
})

4. Yes, double click both expand/collapses and toggles the checkbox. I've posted a fix for this before.

steffenk
3 Nov 2010, 3:06 AM
Hi Condor,

thanks for the tip with the selection model. I only wonder why the checkboxes are not implemented as selection model like in grids.



4. Yes, double click both expand/collapses and toggles the checkbox. I've posted a fix for this before.

do you remember where? I also would like to check/uncheck with single click, if you already did this override i could use it.

Condor
3 Nov 2010, 3:54 AM
Here (http://www.sencha.com/forum/showthread.php?109272-Tree-with-checkbox&p=511316#post511316).

steffenk
3 Nov 2010, 4:41 AM
great, thx Condor!