0
votes

I love RPNiemeijer 's kendo-knockout. I can bind a Knockout observable array containing objects with observable properties directly to the grid.

But.. I need some options in Kendo only available in the datasource (e.g. grouping options)

Is it somehow possible to bind an observable array containing objects with observable properties to a Kendo grid via a datasource?

An observable aware datasource would be great, but I can't find it or know how to create it.

1

1 Answers

1
votes

You can pass in dataSource options along with data or you can pass in a kendo.data.dataSource instance in as data.

For example,

this.gridOptions = {
    data: this.items,
    dataSource: { 
        group: { 
            field: "type"
        } 
    },
    height: 430,
    scrollable: true,
    sortable: true,
    filterable: true,
    columns: [
        { field: "id", title: "ID #", width: "130px" },
        { field: "name", title: "Name", width: "130px" },
        { field: "type", title: "Type", width: "130px" },
    ]             
};

Here is a sample: http://jsfiddle.net/rniemeyer/jZtg5/

Hope that helps!