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

Filter on template columns...

1 Answer 212 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 21 Aug 2015, 06:08 PM

I have a template column with a filter that is not working.  All of my other columns are filtering fine.  When I try to filter on the column below, I get an error concerning "toLowerCase" and it being a proper javascript function.

 

columns: [{

 

template: "<div style='text-align: center'><a href='/ChangeRequest/Details/#:data.request_id#'>#:data.request_id#</a></div>",

field: "request_id",

title: "No.",

 

 

width: 75,

 

filterable: false

 

 

}, {

 

//template: "<a href='/ChangeRequest/Details/#:data.request_id#'>#:data.short_description#</a>",

field: "short_description",

title: "Description",

 

 

width: 225

}, {

 

...more columns...

 

Error:  Unhandled exception at line 610, column 1 in Function code

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'toLowerCase'

 

The error is in Kendo.all.min.js

 

Thanks

 

 
 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 25 Aug 2015, 07:40 AM

Hello Mark,

The reason for the issue is that a schema is not defined for the dataSource, defining the field types, which is required for the filtering to work. Here is an example that demonstrates this.
E.g.

dataSource: {
   ...
   schema: {
       model: {
           fields: {
               OrderID: { type: "number" },
               Freight: { type: "number" },
               ShipName: { type: "string" },
               OrderDate: { type: "date" },
               ShipCity: { type: "string" }
           }
       }
   }

Regards,
Dimiter Madjarov
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
mark
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or