Skip to Content

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

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!

tree.png (6.9 kB)
checkbox.png (30.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 15, 2017 at 01:18 AM

    Hi

    Will this work for you?

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

    Thanks

    -D

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2017 at 10:04 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2017 at 09:48 PM

    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....

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 15, 2017 at 08:23 AM

    Thanks to both of you for your quick help!

    Add comment
    10|10000 characters needed characters exceeded