Add single event for all grids used before grid is rendered

2 posts, 0 answers
  1. Ajinkya
    Ajinkya avatar
    1 posts
    Member since:
    Aug 2020

    Posted 20 Aug 2020 Link to this post

    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>

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2153 posts

    Posted 24 Aug 2020 Link to this post

    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).

Back to Top