Author Topic: Equivalent of getNode(ID) for a normal grid  (Read 464 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 154
    • View Profile
Equivalent of getNode(ID) for a normal grid
« on: July 20, 2025, 04:01:10 am »
In a treeGrid I can get a node using getNode() and passing the ID value in the rowData.

The only way to do this I can see on a normal grid is to create a lookup object {"1234":row, ...} once the data has loaded from the remote source.  Is there a better way?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6415
    • View Profile
Re: Equivalent of getNode(ID) for a normal grid
« Reply #1 on: July 21, 2025, 07:28:04 pm »
There's no equivalent in plain grid.

rowData can be obtained from id as:

Code: [Select]
const row = grid.option('dataModel.data').find(r => r.id === '1234');

for performance-critical code, creating a lookup object as mentioned by you is most efficient way to get row data from id.