e.slice is not a function error
<p>I'm using kendo UI to build a grid but I'm caughting this erro , it seems to be a building erro but i dont know whats wrong or missing.</p>

<p>I read in another forum that making a model solved but it didnt work for me.</p>

<pre><code>function build_grid(result, id)
{
    var gridData = {
        DataColumn1: result.categories,
        DataColumn2: result.datasource[0].data.map(function (a) { return a.value; }),
        DataColumn3: result.datasource[1].data.map(function (a) { return a.value; }),
        DataColumn4: result.datasource[1].data.map(function (a) { return a.percentage; }),
        DataColumn5: result.datasource[2].data.map(function (a) { return a.value; }),
        DataColumn6: result.datasource[2].data.map(function (a) { return a.percentage; })
    };

    var categories = [];
    categories.push({ format:"n0" , field: "DataColumn1", title: "Column 1", width: "60px" });
    categories.push({ format:"n0" , field: "DataColumn2", title: "Column 2", width: "100px" });
    categories.push({ format:"n0" , field: "DataColumn3", title: "Column 3", width: "100px" });
    categories.push({ format:"p2" , field: "DataColumn4", title: "Column 4", width: "100px" });
    categories.push({ format:"n0" , field: "DataColumn5", title: "Column 5", width: "160px" });
    categories.push({ format:"p2" , field: "DataColumn6", title: "Column 6", width: "160px" });



    $(id + "Grid").kendoGrid({
        columns: categories,
        dataSource: {
            data: gridData,
            model: {
                fields: {
                    DataColumn1: { type: "string" },
                    DataColumn2: { type: "number" },
                    DataColumn3: { type: "number" },
                    DataColumn4: { type: "number" },
                    DataColumn5: { type: "number" },
                    DataColumn6: { type: "number" }
                }
            }
        },
            height: 550,
            groupable: true,
            sortable: true,
    });
}
</code></pre>

<p>Erro message:</p>

<pre><code>Uncaught TypeError: e.slice is not a function
    at init.success (kendo.all.min.js:11)
    at Object.success (kendo.all.min.js:11)
    at init.read (kendo.all.min.js:11)
    at kendo.all.min.js:11
    at init._queueRequest (kendo.all.min.js:11)
    at init.read (kendo.all.min.js:11)
    at init.query (kendo.all.min.js:11)
    at init._query (kendo.all.min.js:11)
    at init.fetch (kendo.all.min.js:11)
    at new init (kendo.all.min.js:30)
</code></pre>

<p>Solved , I changed the gridData varaible to an array like mentioned in the comments:</p>

<pre><code>var gridData = [];
        for (var i = 0 ; i &lt; result.categories.length ; i++) {
            gridData.push({
                DataColumn1: result.categories[i],
                DataColumn2: result.datasource[1].data[i].value,
                DataColumn3: result.datasource[1].data[i].percentage,
                DataColumn4: result.datasource[2].data[i].value,
                DataColumn5: result.datasource[0].data[i].value,
                DataColumn6: result.datasource[2].data[i].percentage
            });
        }
</code></pre>

<p>After solving it, I found another erro with the format of my columns, the proper way to format is "{0:n0}" and "{0:p2}" , not "n0" or "p2" like I used before.</p>