Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Data Grid › Not getting selectedRows in rowClick() event
Tagged: datagrid row selection, row selection
- This topic has 5 replies, 2 voices, and was last updated 4 years, 11 months ago by
admin.
-
AuthorPosts
-
December 1, 2020 at 12:41 pm #101194
nikhiljainkke
MemberHi,
we are using selection = {enabled: true, allowRowHeaderSelection: true,}. Now when we select a row, it trigers rowClick() event, In this event we are executing selectedRows = this.getSelection(), but we are not getting current selectedRow detail as it is showing previous selected row detail.
for example if i am selecting any row first time it will return null and if i am selecting row 2nd time it will give me previous selected row detail.
In JQXGrid as soon we select row then in rowClick() event we can get current selectedRow detail by method getselectedrowindex().
Thank you for your help and looking forward to your early reply.
Thank you
Nikhil JainDecember 1, 2020 at 12:55 pm #101197admin
KeymasterHi Nikhil Jain,
The DataGrid ‘change’ event should be used as it is the event raised after the selection is changed.
Example: https://www.htmlelements.com/demos/grid/selection-mode-events/
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/December 1, 2020 at 3:08 pm #101198nikhiljainkke
MemberHi,
Thanks For your response Peter.
This change event will trigger on cell edit and grid refresh also. it will lead to fire unecessary event. Is there any way to get selectedRows details itself in rowClick() event, as we get in JQXGrid.
Thank you for your help and looking forward to your early reply.
Thank you
Nikhil JainDecember 1, 2020 at 3:32 pm #101199admin
KeymasterHi Nikhil Jain,
The ‘change’ event which is raised by the Grid is only raised when selection changes and will have event.detail object. This can be used for detection whether the event is raised by the Grid or by some internal HTML element which is used as an editor for example.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/December 4, 2020 at 9:03 am #101211nikhiljainkke
MemberHi,
any plan to make available getselection() method working in rowclick()/cellclick() events like in JQXGrid in your any next releases.
Thank you for your help and looking forward to your early reply.
Thank you
Nikhil JainDecember 4, 2020 at 11:53 am #101212admin
KeymasterHi Nikhil Jain,
We will consider. We suggest you to use the ‘change’ event which is the special event for selection.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.