cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 TreeTable Check Box Issue

Jagtar
Participant
0 Kudos

In TreeTable check position is changed after scrolling

intial selection

After Scroll

Tree Table is binding is done with oDataModel

Accepted Solutions (0)

Answers (2)

Answers (2)

Jagtar
Participant
0 Kudos

<table:Column width="10em"> <table:customData> <core:CustomData key="p13nData" value='\{"columnKey": "Selected", "maxLength": "1","columnIndex":"0", "filterProperty": "Selected", "sortProperty": "Selected", "leadingProperty": "Selected", "additionalProperty":"DrilldownState"}'/> </table:customData> <CheckBox id="id" selected="false" />

<table:template>

<CheckBox selected="{Selected}" />

</table:template>

</table:Column>

jorge_cabanas
Participant
0 Kudos

Hi Jagtar,

This is right. It is the standard behaviour of Tree Table. I had to deal with the same problem.
The point here is that after every render, the internal index of the table change. Unless you make a method which run every time the data change in the table updating the selection, I would not recommend you this control.

I strongly suggest you to use Tree in combination with CustomTreeItem where you can add checkbox and text controls , for example.
It makes the same functionality. The only "negative" point is that you have to customize the content of "CustomTreeItem", but trust me... is not a problem.

Kind regards,
Jorge

jorge_cabanas
Participant

Did this suit/help you?

Kind regards,
Jorge

Jagtar
Participant
0 Kudos

Thanks a lot for your suggestion,

Its works for me as you suggested .

I have also find alternative to bind tree table to local model and oData Model its works for this .

I have created one field Selected and binded to my check box it tracking the selection and it works

jorge_cabanas
Participant
0 Kudos

I'm happy to hear it Jagtar 🙂

Then, please close the question marking the correct answer if it helped you

Best regards,
Jorge