rsangin
rsangin

Reputation: 498

Uncaught TypeError: e.charAt is not a function in kendo grid

I am using kendo UI grid. When I try to draw grid I get the error:

Uncaught TypeError: e.charAt is not a function

Here's my code:

var columns = [{title: 'id', field: '["id 1"]', encoded: false}];
var dataSource = {data: [{'id 1': '<span style="background: yellow; color: black;">21</span>' } , {'id 1': '<span style="background: yellow; color: black;">21</span>' }]}

    $("#grid").kendoGrid({
        dataSource: dataSource,
        scrollable: true,
        groupable: true,
        sortable: true,
        filterable: {
            mode: 'row'
        },
        selectable: "multiple",
        resizable: true,
        pageable: {
            pageSize: 1000,
            buttonCount: 4
        },
        columns: columns,
        height: '95%'
    });

You can run my code here: http://dojo.telerik.com/uNUTI/4


It happens after I add the filterable option. Without that option everything would work fine.

Does anyone know how to solve this problem?

Upvotes: 0

Views: 3056

Answers (1)

Mantas Čekanauskas
Mantas Čekanauskas

Reputation: 2228

You are getting this error, because field option for object in columns should be a valid property name. Thought you can have object property with white spaces in JavaScript, but in kendo it should not contain white spaces.

Once you change id 1 to id_1, and ["id 1"]' to 'id_1', you should get expected results

Kendo Dojo

Upvotes: 3

Related Questions