Skip to Content
avatar image
Former Member

Making rows of sap.ui.table.TreeTable selected

Hello experts,

I have Tree table in my application which shows Organization hierarchy in a dialog.I have a requirement wherein previously selected organizations should be selected default if I close the dialog and again open it.

For eg : Below Dialog is opened for the first time and I select 1 organization and close the dialog.

Now after opening the dialog, I want "Test_Org" organization to be selected by default. I am unable to achieve this requirement.

Organizations are loaded from backend when dialog gets opened.So on attachRequestCompleted() of Odata model, I tried to get the data from table by calling getRows() method assuming data is already loaded in the table from Odata call so that I can compare with my array which contains already selected organizations. However, I am not getting any entries in the table yet for comparision in attachRequestCompleted() method.

There is another issue as well wherein If I expand the node "Org for Testing" and select the organization "Org2" and now I collapse the node. Again when I expand the same node Organization "Org2" is deselected.

Regards,

Karan

tree-table.png (32.1 kB)
expanded-node.png (32.2 kB)
expand2.png (31.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 21, 2017 at 01:15 PM

    Hello guys,

    Can anybody help me out with this issue.

    Regards,

    Karan.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 04, 2017 at 01:18 PM

    Hi Karan,

    You can have an extra column for check box and achieve this.

    Try this code if it is helpful, tree table with dynamic check box enabling.

    https://jsbin.com/metufiw/5/edit?js,output.

    Regards,

    Mahi Theja.

    Add comment
    10|10000 characters needed characters exceeded