cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.tree with mode: multiselect -> make checkboxes NOT editable

danielspiess
Explorer
0 Kudos

Hello everybody,

is it possible to make the checkboxes of a sap.m.tree with mode multiselect so that they are not editable anymore?

The case I have looks similar to this:

I have also set this up in jsbin:
http://jsbin.com/lemerusapa/edit?html,js,output

Now I would like to make sure, that once the tree is loaded the checkboxes cannot be edited anymore.

I guess, that I will have to access the "editable-porperty" of the checkboxes:

But I didn't specifically create the checkboxes, but rather just chose the mode="MultiSelect" for the Tree in order for the checkboxes to show up. And now I have no clue how to access them to change the property.

Thanks in advance for your help!

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor

Hi

Will this work for you?

http://jsbin.com/vexoso/edit?html,js,output

Thanks

-D

Answers (3)

Answers (3)

former_member365727
Active Contributor

Tree control is a composite control which contains check box and text elements. Check box properties cannot be accessed directly as this is defined as a private aggregation...

Found a dirty method for your problem(dont use this in production as after upgrade's property name might change). use the below code to disable check box...in this case disabling checkbox for item 0 (root item)

this.getView().byId("Tree").getItems()[0]._oMultiSelectControl.setEditable(false);

Update JSBin code

danielspiess
Explorer
0 Kudos

Thanks to both of you for your quick help!

former_member365727
Active Contributor
0 Kudos

From UIControl(tree) point of view multi select means you are enabling the control so that user can select entries. With standard properties this may not be possible....