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

[Solved] Grid Filtering Issue - Enums in Client OperationMode

4 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ron DeFreitas
Top achievements
Rank 2
Ron DeFreitas asked on 04 Oct 2011, 06:39 PM
I'm not sure if you guys have this fixed in the Commercial license, but I noticed this issue and found the fix for it in version 2011.2.712.  My apologies if this is the wrong forum or if this was already answered, but since I couldn't find it myself I had to go digging.

Problem:
Only tested this in Firefox, but attempting to filter on a numeric Enum column while in Client OperationMode would fail to change the grid, and would yield the following error in Firebug:

aE.toLowerCase is not a Function

Source:
I located the issue in telerik.common.js - line 1743
if(typeof expr.value === "string" && !expr.caseSensitive) {
     caseSensitive = function(value) {
        return value.toLowerCase();
     };

Solution:
The assumption was made that the filtered value was a string in all cases.  Cast it to a string and move on with your life :)
if(typeof expr.value === "string" && !expr.caseSensitive) {
     caseSensitive = function(value) {
        return value.toString().toLowerCase();
     };


Attachments:
I've attached a new version of telerik.common.min.js for users of version 2011.2.712 that resolves this issue.

[Edit - The previous version I attached still had an extra debugger... this one should be fine]

4 Answers, 1 is accepted

Sort by
0
Ron DeFreitas
Top achievements
Rank 2
answered on 04 Oct 2011, 06:46 PM
Hmmm, frustrating that you cannot remove posted files on this forum...

Here is the correct attachment.
0
Accepted
Rosen
Telerik team
answered on 05 Oct 2011, 10:00 AM
Hi Ron Defreitas,

Thank you for reporting this. We were able to locate the problem. The fix will be available with next version of the component. Meanwhile I have updated your telerik points.

Regards,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Ron DeFreitas
Top achievements
Rank 2
answered on 05 Oct 2011, 02:27 PM
Thanks Rosen,

Here is the complete snippet I ended up fixing, as failing to cast the other value to a string was causing a different error...  (again, starting from line 1743)

if(typeof expr.value === "string" && !expr.caseSensitive) {
     caseSensitive = function(value) {
        return value.toString().toLowerCase();
     };
} else {
    caseSensitive = function(value) {
        return value.toString();
    };
}
0
aasda
Top achievements
Rank 1
answered on 09 Oct 2011, 09:46 PM
I also did get error on same lines, but my error was value is null error. This happened when i was grouping in mvc grid on a column which also had null values. So did change those lines with null check. I am not really good at javascript, but it works onmy mahine
if(typeof expr.value === "string" && !expr.caseSensitive) {
     caseSensitive = function(value) {
        return  value == null ? "" : value.toString().toLowerCase();
     };
} else {
    caseSensitive = function(value) {
        return value == null ? "" : value.toString();
    };
}

Tags
Grid
Asked by
Ron DeFreitas
Top achievements
Rank 2
Answers by
Ron DeFreitas
Top achievements
Rank 2
Rosen
Telerik team
aasda
Top achievements
Rank 1
Share this question
or