Globally override or tap into all Kendo Grids

1 Answer 135 Views
Data Source Grid
Raihan
Top achievements
Rank 1
Raihan asked on 11 May 2023, 12:43 AM

Hi,

We are looking into ways on how we can globally Html Sanitize/Purify anything that is rendered on a Kendo Grid. We are looking into the following options:

1. Create a custom widget that extends the Kendo Grid

2. Globally tap into databinding event

It would be awesome if the second option is possible.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 May 2023, 03:40 PM

Hello Raihan,

Kendo UI provides options for you to create your own components by inheriting from the base widget class. Please refer to the following article giving more information on this:

Regarding the second option, can you share more information on this? 

Genrally, you can apply the same handler to all Grids and so it will execute for all of them:

      $("#grid").kendoGrid({
        columns: [
          { field: "name" },
          { field: "age" }
        ],
        dataSource: [
          { name: "Jane Doe", age: 30 },
          { name: "John Doe", age: 33 }
        ],
        dataBinding: dataBindingHandler
      });

      $("#grid2").kendoGrid({
        columns: [
          { field: "name" },
          { field: "age" }
        ],
        dataSource: [
          { name: "Jane Doe", age: 30 },
          { name: "John Doe", age: 33 }
        ],
        dataBinding: dataBindingHandler
      });

      function dataBindingHandler() {
        console.log("event fired")
      }

Dojo demo: https://dojo.telerik.com/okeGeYaB

Regards,
Nikolay
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
Data Source Grid
Asked by
Raihan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or