cancel
Showing results for 
Search instead for 
Did you mean: 

Making rows of sap.ui.table.TreeTable selected

karanshaheri
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

karanshaheri
Participant
0 Kudos

Hello guys,

Can anybody help me out with this issue.

Regards,

Karan.