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

Cannot call method 'toLowerCase' of undefined when trying to filter on a grid

3 Answers 641 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shane P
Top achievements
Rank 1
Shane P asked on 02 Apr 2012, 09:19 PM
I have a grid where I am trying to use the filter feature however I always get an error
Uncaught TypeError: Cannot call method 'toLowerCase' of undefined 
I have tried using all of the scripts just to test that I am not missing a script however I still get the same error

I don't think I am doing anything wrong with my code.

I have a row template that looks like

<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr data-id="${ Id}">
                    <td>
                        ${ Description}
                    </td>
                    
                </tr>
</script>

My table layout looks like
<table id="mytable">
     <thead>
         <tr>
             <th>
                 Description
             </th>
              
         </tr>
     </thead>
     <tbody>
         <tr>
             <td colspan="1">
             </td>
         </tr>
     </tbody>
 </table>

I am setting up the grid like 
$("#mytable").kendoGrid({
           dataSource: {
               transport: {
                   read: "/api/details/get"
               },
               pageSize: 10
           },
           height: 250,
           filterable: true,
           sortable: true,
           selectable: "row",
           change: onChange,
           pageable: true,
           editable: "popup",
           toolbar: kendo.template($("#template").html()),
           rowTemplate: kendo.template($("#rowTemplate").html())
       });
   });

Can anyone let me know what I am doing wrong?

3 Answers, 1 is accepted

Sort by
0
Khushali
Top achievements
Rank 1
answered on 03 Apr 2012, 07:11 AM
Most probably it might be an issue of datatype.. You might be filtering on number, but in your column definition it might be string. Check the datatype.

Regards,
Khushali
0
Shane P
Top achievements
Rank 1
answered on 03 Apr 2012, 07:26 AM
Hey Khushali,

My description field is a string field. 

Another strange thing happening is when I try sorting only the first 2 rows are sorted.
0
Khushali
Top achievements
Rank 1
answered on 03 Apr 2012, 09:47 AM
Hi,

Just got to know the issue. I think you are missing the "data-field" in your th element. I just tried using some hardcoded values. You can see the demo.May be that can solve your issue.

Regards,
Khushali
Tags
Grid
Asked by
Shane P
Top achievements
Rank 1
Answers by
Khushali
Top achievements
Rank 1
Shane P
Top achievements
Rank 1
Share this question
or