Reputation: 473
I have a Kendo UI Web Grid bound to a local Javascript Array. Each item in the JS Array has a field userType
which is an integer. I used the column.values
configuration to define Textual representations of the values. However, when I try to filter on the column, there is a TypeError: Object 1 has no method 'toLowerCase'
. I guess it is failing to treat the column as an integer and trying to convert it into a string.
See this fiddle for example: http://jsfiddle.net/t97pY/
Filtering on the 'userType' column causes the issue.
Is this a bug in the Kendo Grid? If so, how do I get it reported and resolved?
Upvotes: 1
Views: 1931
Reputation: 1089
The grid always assumes the data type is string. The solution is to add a schema definition to your data source.
dataSource: {
data: [{
name: "Jane Doe",
age: 30,
userType: 0
}, {
name: "John Doe",
age: 33,
userType: 1
}],
schema: {
model: {
fields: {
age: { type: 'number' },
userType: { type: 'number' }
}
}
}
}
I modified your fiddle: http://jsfiddle.net/t97pY/4/
Upvotes: 2