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

Add single event for all grids used before grid is rendered

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajinkya
Top achievements
Rank 1
Ajinkya asked on 20 Aug 2020, 02:47 PM

I am using kendo grid on multiple elements throughout my app. I want to do few changes wherever any grid is loaded fully.

Is there a way to write common function for all grids before grid is loaded ?

for ex - 

<script>

function afterGridRendered(){};
// code to bind above method to all grids 

$("#grid").kendoGrid({
            ...
        });

</script>

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 24 Aug 2020, 12:16 PM

Hello ,

You can handle the Grid's dataBound event, which fires after the Grid is loaded with data. If you want to execute logic before it is loaded with data, handle the dataBinding event instead. afterGridRendered can be a common handler used by multiple Grids.

Here's an example, in which 2 Grids use the same afterGridRendered handler: https://dojo.telerik.com/aqEgOJEr

Regards,
Ivan Danchev
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
Ajinkya
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or