3

I am refreshing the grid every second or so. Once a row is selected, I want to keep the same row selected on the next refresh. Is there a way to load the table with a row selected to maintain a stable selection (so that the user will feel that the row is always selected even with data refresh)?

Also, on every refresh, the rowData is a different object reference.

techguy2000
  • 4,861
  • 6
  • 32
  • 48

3 Answers3

0

Unfortunately not out of the box. What you need to do is something like this:

  1. Before refreshing your data use api.getSelectedNodes() and store your unique key to identify the node/row
  2. Refresh data
  3. Iterate through your grid and compare Node/row with the stored key
  4. Select the found node/row manually by using node.setSelected(true);
Alexander Zbinden
  • 2,315
  • 1
  • 17
  • 21
0

With getRowNodeId functionuse

deltaRowDataMode = true 

Every row should have a unique id.

Hemerson Tacon
  • 2,419
  • 1
  • 16
  • 28
0

Since more than a year and half is passed, I hope my answer would be still useful.

You don't need to load the data with preselected row, or store selected rows somewhere and reselect them programatically when data is reloaded. The solution is to not overload the table rows every time you receive a new data.

For that you may use Transaction Updates which only updates cell values and keeps every other data (and metadata).

RezKesh
  • 2,861
  • 2
  • 24
  • 35