kendo ui grid filter doesn't work for integer type columns

I have a problem with Kendo UI. I can't filter on some columns.

Here's a plunker with my example where I try to filter on the columns id, prog or Max Temps and it doesn't work.

<body>
    <div id="grid"></div>
</body>
<script>
    $("#grid").kendoGrid({
        dataSource: [
            { id: 36308, reportDate: "2015-02-01", prog: 58, state: "Waiting", maxTemps: 0 }, 
            { id: 36309, reportDate: "2015-02-01", prog: 34, state: "Complete", maxTemps: 86400 },
            { id: 36310, reportDate: "2015-02-01", prog: 116, state: "Complete", maxTemps: 86400  },
            { id: 36311, reportDate: "2015-02-02", prog: 58, state: "Complete", maxTemps: 86400 }
        ],
        filterable: true,
        columnMenu: true,
        columns: [
            { field: 'id', title: 'Id', width: '80px' },
            { field: 'reportDate', title: 'Report Date', width: '100px' },
            { field: 'prog', title: 'Prog', width: '60px' },
            { field: 'state', title: 'Status', width: '130px' },
            { field: 'maxTemps', title: 'Max Temps', width: '100px' }
        ]
    });
</script>

I have this error on Chrome:

Uncaught TypeError: (d.prog || "").toLowerCase is not a function

and this one on Firefox:

TypeError: "".toLowerCase is not a function.

I think it's because my data type is integer on these columns. I don't know how to solve this. Any ideas?

Upvotes: 6

Views: 8872

Answers (2)

William
William

Reputation: 539

It should be "number" in the schema as well. I had "int" and it still didn't work

Upvotes: 2

Sridhar Narasimhan
Sridhar Narasimhan

Reputation: 2653

You need to define the type number so that there wont be any issue with number filtering. Refer below code

columns: [

    { field: 'prog', type:'number',  title: 'Prog', width: '60px' },

  ]

Upvotes: 5

Related Questions