Uncaught TypeError: Cannot read properties of undefined (reading 'id') we are trying to read from dataBoundNoResultsDisplayCheck(e) with this code e.sender.table.id

1 Answer 2434 Views
Grid
Mihir Desai
Top achievements
Rank 1
Mihir Desai asked on 04 Apr 2022, 06:30 AM

Hi Team,

In my application below jQuery version has been updated

"~/Scripts/jquery-3.6.0.min.js",
"~/Scripts/jquery-migrate-3.4.0.min.js", 

 

  After the upgraded version I am getting Uncaught TypeError: Cannot read properties of undefined (reading 'id')  this error 

In in my kendo grid like this  .Events(command => command.DataBound("onGridDataBound"))

 function onGridDataBound(e) {

        dataBoundNoResultsDisplayCheck(e);

//some custom business logic is here

}

and the error generating function is below 

 

   

function dataBoundNoResultsDisplayCheck(e) {

          switch (e.sender.table.context.id)

               {

                }

}

 

on the basis of id code is running but now after the update not able to get grid id can you help me on this finding workaround here for getting kendo grid id in event 

1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 06 Apr 2022, 01:45 PM

Hi Mihir Desai,

One way you can get the id of the Kendo UI Grid with the current Kendo UI version(2022.1.301) during the dataBound event is to use the following:

JavaScript

    function onDataBound(e){
        var GridID = e.sender.element[0].id;
    }

Please take a look at the following Progress Kendo UI Dojo which demonstrates the above in action, and let me know if you have any questions. 

Regards,
Patrick | Technical Support Engineer, Senior
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Mihir Desai
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or