I'm unsure of how to get the data grouped properly for a list view. I think the problem is in my datasource definition although it may also be a problem with my list binding. Any tips or suggestions for my data source are greatly appreciated.
I'm sending data in the following format from a webservice I have written:
And my datasource formatted as so:
Now I want my mobile list view to be grouped by length as the datasource is setup for. My mobile list view is not grouped. This grouping is not configurable by the user nor intended to be. I just want my list grouped on length.
Fires on view render:
I'm sending data in the following format from a webservice I have written:
{ "count" : 3, "queryData" : "users", "results" : [ { "length" : 2, "result" : "1A" }, { "length" : 2, "result" : "9F" }, { "length" : 3, "result" : "F03" } ]}And my datasource formatted as so:
var ds = new kendo.data.DataSource({ transport: { read: { url: "http://localhost:12392/api/process", dataType: "jsonp", data: { queryData: 'users' } } }, schema: { data: function(data) { return data.results }, total: function(data) { return data.count }, model: { fields: { length: { type: 'number' }, result: { type: 'string' } } }, group: { field: 'length' } }});Now I want my mobile list view to be grouped by length as the datasource is setup for. My mobile list view is not grouped. This grouping is not configurable by the user nor intended to be. I just want my list grouped on length.
Fires on view render:
function resultsBind() { // Old local data version with correct grouping // $("#grouped-listview").kendoMobileListView({ // dataSource: kendo.data.DataSource.create({data: groupedData, group: "length" }), // template: "#= result #", // headerTemplate: "Group ${value}" // }); $("#grouped-listview").kendoMobileListView({ dataSource: ds, template: "#= result #", headerTemplate: "Group ${value}" });}