KendoUI : TypeError: n.slice is not a function

common error in Kendo UI that has a simple solution

The error:
TypeError: n.slice is not a function

Is not very clear, but it is pretty simple. You are generally using some sort of AutoComplete, DataGrid, etc. This simply means that you are not returning a collection (JSON), but a layer (or more) up from that collection you want to include. For example, you would be returning this JSON:
{
    "TrackingModels":[
        {"Id":17,"Name":"Bill"},
        {"Id":17,"Name":"Bob"}
    ]
}

When what Kendo is expecting is just this:
{[
    {"Id":17,"Name":"Bill"},
    {"Id":17,"Name":"Bob"}
]}

Comments are closed