This is a migrated thread and some comments may be shown as answers.

Exception with Grid After Updating to Latest Build (2013.2.716.340)

8 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Patrick asked on 17 Jul 2013, 06:30 PM
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

8 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 18 Jul 2013, 07:53 AM
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!
0
Patrick
Top achievements
Rank 2
answered on 18 Jul 2013, 11:48 PM
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.};
0
Rosen
Telerik team
answered on 19 Jul 2013, 06:03 AM
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!
0
Patrick
Top achievements
Rank 2
answered on 19 Jul 2013, 11:31 AM
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
0
Patrick
Top achievements
Rank 2
answered on 24 Jul 2013, 02:36 PM
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
0
Nikolay Rusev
Telerik team
answered on 25 Jul 2013, 07:54 AM
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!
0
Patrick
Top achievements
Rank 2
answered on 25 Jul 2013, 11:22 AM
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
0
Accepted
Nikolay Rusev
Telerik team
answered on 25 Jul 2013, 03:38 PM
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!
Tags
Grid
Asked by
Patrick
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Patrick
Top achievements
Rank 2
Nikolay Rusev
Telerik team
Share this question
or