This is a migrated thread and some comments may be shown as answers.

kendo grid "afterInsertRow" event

2 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SRistic
Top achievements
Rank 1
SRistic asked on 01 Aug 2019, 01:53 PM

As title says, I'm searching for the "afterInsertRow" event function in grid, with parameters "rowElement" - to which I can apply some css style or add a class, and "rowData" - from which I can get data source?

Basically, I need this function after the row is added to the table, to make some condition and apply style to it.

That style should remain no matter what other events I perform on the table, like sorting, filtering or whatever action is performed on table.

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 02 Aug 2019, 08:42 AM
Hello Stefan,

You can achieve this requirement differently depending on the following:

Without paging enabled:

You can try using one of these events:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/events/change
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/events/requestend
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/events/sync

With paging enabled:

To focus/select a specific item, you will need to first find out on what page the record is located. To do that you can define some order in your database (usually there is such an order by default), then find the position of the item according to this order and then divide by the page count. You can again use the events provided above.

If you want to preserve the selection of this record upon paging, sorting, filtering, etc., you can implement the following approach:
https://docs.telerik.com/kendo-ui/knowledge-base/persist-row-selection-while-paging

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
SRistic
Top achievements
Rank 1
answered on 02 Aug 2019, 10:40 AM
Thank you Eyup!
Tags
Grid
Asked by
SRistic
Top achievements
Rank 1
Answers by
Eyup
Telerik team
SRistic
Top achievements
Rank 1
Share this question
or