Exception with Grid After Updating to Latest Build (2013.2.716.340)

9 posts, 1 answers
  1. Patrick
    Patrick avatar
    19 posts
    Member since:
    Jul 2010

    Posted 17 Jul 2013 Link to this post

    I've noticed now the grid is posting filter data even though I haven't defined any filter on the client/server side. This is causing a Binding error - DataSourceRequest.

    When I create a dummy filter with the wrapper it no longer throw exception. However even if I disable the Filterable option it still throws and passing filter post data.
    .DataSource(ds => ds.Ajax()
                               .Batch(true)
                               .Filter(f=> f.Add(d=> true))
    See the examples of post data between working and not. I'm not sure if it's the wrappers or the JS but thinking it might be Js causing the Binding to throw.

    Old Post Format:
    sort=FacilityName-asc&page=1&pageSize=25&group=&filter=

    New Post Format Failing:
    sort=FacilityName-asc&page=1&pageSize=25&group=&filter=undefined~undefined~undefined

    New Post Format Working - see above for the dummy filter:
    sort=FacilityName-asc&page=1&pageSize=25&group=&filter=undefined~eq~null


    Please advise.
    Patrick
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 18 Jul 2013 Link to this post

    Hello Patrick,

    I tried to recreate the issue you have described but to no avail. Therefore it will be appreciated if you could provide a small sample in which this issue can be observed locally.

    Regards,
    Rosen
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Patrick
    Patrick avatar
    19 posts
    Member since:
    Jul 2010

    Posted 18 Jul 2013 Link to this post

    Hi Rosen,

    I  able to track down the issue, I think. If you add the below Array prototype to a .js file or in the master/layout page you'll get the same error but it will work if you add the filter option I mentioned in my first post. Let me know once you add the JS if you are now able to reproduce the issue.

    BTW this issue didn't exist before the latest update.

    Thanks,
    Patrick

    1.Array.prototype.remove = function (from, to) {
    2.    var rest = this.slice((to || from) + 1 || this.length);
    3.    this.length = from < 0 ? this.length + from : from;
    4.    return this.push.apply(this, rest);
    5.};
  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 19 Jul 2013 Link to this post

    Hello Patrick,

    In the meantime we have identified the caused for the issue and managed to address it. Please download the latest internal build and give it a spin. I have also updated your telerik points as token of gratitude. 

    Regards,
    Rosen
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Patrick
    Patrick avatar
    19 posts
    Member since:
    Jul 2010

    Posted 19 Jul 2013 Link to this post

    Rosen,

    I got the latest internal bits but the issue is still happening. If you add that bit of JS with the latest bits does it error for you?

    Thanks,
    Patrick
  7. Patrick
    Patrick avatar
    19 posts
    Member since:
    Jul 2010

    Posted 24 Jul 2013 Link to this post

    Rosen,

    Could you please confirm if you get the exception or not when adding the JS I posted when using the latest bits.

    Thanks,
    Patrick
  8. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 25 Jul 2013 Link to this post

    Hello Patrick,

    The issue that we discovered (reported by you and few other clients) was related to how complex fields (Category.CategoryID) were handled on sorting/filtering etc. We believe that the internal build in question contains the fix for it.

    For your convenience I'm attaching sample project implementing the above described scenario. Sorting/filtering for `Category` column wasn't working with the official Q2 2013 release. It is working with the scripts from the internal build.

    If you think that the issue in your project is not related to this, please modify the example in order to replicate the erroneous behavior.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  9. Patrick
    Patrick avatar
    19 posts
    Member since:
    Jul 2010

    Posted 25 Jul 2013 Link to this post

    Nikolay,

    I still have the exception and you can see in the attached code. I've updated it to use the LocalDb vs. SqlExpress as I don't have it installed. I've added the JS in question (adding a remove to Array type) and disabled filtering. However the exception is still thrown. Let me know if you're able to see the exception or not with my updates.

    Thanks,
    Patrick
  10. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 25 Jul 2013 Link to this post

    Hello Patrick,

    As you probably know overriding JavaScript natives prototype is considered bad practice as it may lead to collisions with other libraries. This is exactly the case with the code you use Array.prototype.remove = function () { ... }.

    The above code breaks how jQuery.isEmptyObject() function works which distributes the error over our code base.

    We will attempt to patch our code in order to avoid the side effects of this override in next internal build, but you should avoid this pattern as it may lead to other unexpected behaviors.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready