question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table method getRows() returns only visible Rows

See original GitHub issue

In my use case I wanted to get the selected indices and the related rows. So I used the methods getSelectedIndices() and getRows(). But to my utter surprise I only get the actual visible rows, but the indices are the “real” indices (so when scrolled down they start fortunately NOT with 0).

In my opinion this is a bug, because working with indices and the rows becomes useless. Also the method should be called “getVisibleRows()” or something similar to make it clear.

Actual I use “the workaround” that I use the indices with my related model.

OpenUI5 version: 1.24.2

Browser/version (+device/version): Google Chrome 41.0.2272.118 (64-bit)

Any other tested browsers/devices(OK/FAIL): Firefox 37.0.1

Steps to reproduce the problem:

  1. Open the JSBin example
  2. Click the button and look into the console
  3. Scroll the table down, click the button and look into the console again http://jsbin.com/pujokiyusa/1/edit?html,console,output

What is the expected result? getRows() should return ALL rows

What happens instead? It returns only the displayed rows

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
joeybronnercommented, Apr 1, 2017

Hi,

Can you please update the openui5 documentation https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.table.Table.html#getRows ? I lost time to understand why I only get visible rows with the getRows() method… until I found this post.

Thank you guys.

0reactions
EricVanEldikcommented, Nov 18, 2022

This looks a bit weird to me. The 2nd line is essentially the same as the event handler. What are you trying to achieve thereby?

Maybe https://openui5.hana.ondemand.com/api/sap.ui.model.ListBinding#methods/getAllCurrentContexts is what you are looking for?

The second line is to initialize, because attachChange is only called on a change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UI5 Table getRows() returns rows array size below the ...
oTable.getRows() will return only visible rows count. I have written code in rowSelectionchange. Not sure you are looking like this, but pls ...
Read more >
sapui5 - smarttable get all rows - Stack Overflow
getRows() method of the underlying table returns only visible rows. I don't want to switch to use ui.table.Table as there are some nice...
Read more >
sap.ui.table.Table - API Reference - Demo Kit - SAPUI5 SDK
Specifies if a select all button should be displayed in the top left corner. This button is only displayed if the row selector...
Read more >
ExcelScript.Range interface - Office Scripts | Microsoft Learn
Specifies the type of data in each cell. getVisibleView(). Represents the visible rows of the current range. getWidth(). Returns the distance in points,...
Read more >
Methods - Bootstrap Table
Get all rows hidden, and if you pass the show parameter true , the rows will be shown again. Otherwise, the method only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found