Author Topic: Get current selected rows  (Read 3094 times)

groupXS

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 9
    • View Profile
Get current selected rows
« on: February 02, 2018, 02:05:58 pm »
Hi,

Is there any way to get all selected rows or I have to do it manually?
I can listen to rowSelect event and use ui.addList and ui.deleteList and keep that list manually, but problem arise since user can delete one or more seletected rows and use Undo / Redo. Then it is hard to say what is selected or not.
I can use jQuery to access all .ui-state-highlight divs, but then is there a way to get data corresponding to that div?

Thank you

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6201
    • View Profile
Re: Get current selected rows
« Reply #1 on: February 02, 2018, 07:26:09 pm »
jQuery way is not recommended because of virtual rendering; only the visible rows are rendered in the viewport.

There is straightforward API to get selected rows:

Code: [Select]
grid.SelectRow().getSelection()

https://paramquery.com/pro/api#method-SelectRow