Client side Grid events not firing

5 posts, 1 answers
  1. Eric
    Eric avatar
    24 posts
    Member since:
    Dec 2010

    Posted 23 Apr 2020 Link to this post

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

  2. Eric
    Eric avatar
    24 posts
    Member since:
    Dec 2010

    Posted 23 Apr 2020 in reply to Eric Link to this post

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

  3. Eric
    Eric avatar
    24 posts
    Member since:
    Dec 2010

    Posted 23 Apr 2020 in reply to Eric Link to this post

    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.
  4. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 27 Apr 2020 Link to this post

    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.
  5. Eric
    Eric avatar
    24 posts
    Member since:
    Dec 2010

    Posted 27 Apr 2020 in reply to Alex Hajigeorgieva Link to this post

    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.
Back to Top