cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 - sap.m.Table visible row count

istvanherman
Explorer
0 Kudos

Hello,

I am working on a project with SAPUI5 and I am stucked with this problem. I have a table on a view and in this table we have several rows. There is a filter function for the table and if the user type in a filter which gives back only one row, then I would like to select that one row automatically. For this I need the numbers of the visible rows I guess and if it is equal 1 then select it or else don't do anything.

Can anybody helps me to solve this problem?

I know that sap.ui.table.Table has rowcounter, and I need a similar solution but with sap.m.Table.

Thank you,

Istvan

Accepted Solutions (1)

Accepted Solutions (1)

vaibhav_gb
Explorer

Hey,

check this example, it will guide you through:

>> gbvaibhav-gist code,

>> Example

regards

GB

istvanherman
Explorer

Hi,

Thank you this works! I don't know how I didn't find this property.

Thank you very much!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Herman,

If you can check the count of rows appearing after filter operation.Like a count of array which generated after your filtering operation .you can make that particular row "selected" property to true on the condition the count is only one.

istvanherman
Explorer
0 Kudos

I do not understand exactly how do you mean this. After my filter operation in the JSON model still there are all of the rows.

Can you explain it or show me a solution please?

Thank you!

Former Member
0 Kudos

I dont know how you are filtering.But if you can find the "Indicies" (Property) array, there you can see the only filtered rows list.