PDA

View Full Version : checkbox treepanel



sowmyaranjan
5 May 2014, 2:51 AM
Hi,

Is there any way to show/hide check box in check box tree panel.

I am looking for any CSS way that can applied to getRowClass().

Any help is appreciated.

Thank you!

jsakalos
5 May 2014, 3:31 AM
This works:
Ext.fly(tree.getView().getNode(nodeWithCheckbox)).select('input').setVisible(false);

sowmyaranjan
5 May 2014, 11:55 AM
it did not work,is there any css class available to hide check box in tree panel?

jsakalos
5 May 2014, 3:08 PM
Do you want to hide one specific checkbox or all checkboxes? If all, then just do not set checked field either to false or true but leave it undefined.

It is very difficult to hide one specific checkbox with css alone as you would need to get its id.

You could add a cls to the record, e.g. 'hide-checkbox'; then rule should read:

.hide-checkbox input[type=button] {
visibility: hidden;
}

Btw, the above does work. To test:
1. navigate to http://docs.sencha.com/extjs/4.2.2/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#check-tree
2. in the console type


tree = Ext.ComponentQuery.query('treepanel')[1];
Ext.get(tree.getView().getNode(tree.getRootNode().findChild('text', 'Go jogging', true))).select('input[type=button]').setVisible(false)