This is a migrated thread and some comments may be shown as answers.
Client side Grid events not firing
4 Answers 53 Views
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 23 Apr 2020, 12:50 PM

Any hints as to why I can't get the DataBound client side event to fire on my grid?  The server side Ajax call is definitely happening and I can see the wait spinner start and stop.  It appears as though every other part of the Grid is rendering properly, but I cannot get any of the events in the browser to fire. Are there any particular client side libraries that need to be configured?  I already had an issue where I found I needed to upgrade my jquery version in order for the Ajax bind to occur.

Subscribe using jquery:

$(document).ready(function () {     var grid = $("#GridAppointmentAllList").data("kendoGrid");     grid.bind("dataBound", xx_onDataBound2); })

Subscribe using Fluent API:

.Events(events => events.DataBound("xx_onDataBound").DataBinding("xx_dataBinding"))

4 Answers, 1 is accepted

Sort by
0
Eric
Top achievements
Rank 1
answered on 23 Apr 2020, 03:30 PM

I figured out part of the issue, but am now stuck on something new.  I found that the Error client event was firing with "Internal Server Error", even though the server action ran without any errors.  I added the AllowGet optional parameter to the data binding method and I no longer get the client side error; however, now the spinner of the grid never goes away.  It is as if the server call is taking forever, but I know that is not the case, as it completes in less than a second, also, there is no more client side error being thrown, so I have nothing to go by.

 

return Json(dataList.ToDataSourceResult(request)     , JsonRequestBehavior.AllowGet);

0
Eric
Top achievements
Rank 1
answered on 23 Apr 2020, 03:54 PM
I found that the Change client event was firing first and there was an error in that code, which was preventing the wait spinner from completing.  I think the original issue that I posted about is taken care of.  Now, I just need to figure out my client side code so that it doesn't throw any errors.
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 27 Apr 2020, 10:07 AM

Hello, Eric,

The Kendo UI Grid for ASP.NET MVC data source uses a POST request by default when it is Ajax() bound, so it should not be necessary to add the AllowGet in the controller.

If you need further assistance, it is better to provide a code snippet of the entire grid and data source as well as the controllers.

As for the client side error, are you referring to the dataSource change event or the grid change event?

Let us know in case you need help with that.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Eric
Top achievements
Rank 1
answered on 27 Apr 2020, 01:54 PM
I originally was using the dataSource change event, but eventually discovered that I really wanted the grid change event.  I also eventually managed to get everything using with the default Post behavior, without having to override it to Get.  I am converting some old Telerik Grid code to use Kendo Grid and it has taken me a while to discover many of the syntax differences, but I believe I have figured most of it out, now.  Thank you.
Tags
Grid
Asked by
Eric
Top achievements
Rank 1
Answers by
Eric
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or