Hi All,
I am creating the grid via javascript. The datasource is connected directly to the webservice. An example of the webservice result is the following:
[ { col1: "",
col2: "",
Items: [ { ....} }
}]
Instead of using the main result like col1 and col2 I need to use the Items. How can I specify that using the example below?
var locationItems = $("#grid").kendoGrid({
columns: lockedGridColumns(),
height: 500,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
//reorderable: true,
//resizable: true,
autoBind: false
}).data("kendoGrid");
function getItems(locationId) {
if (locationId == null) {
locationId = 0;
}
var dataSource = new kendo.data.DataSource(locationId != 0 ?
{
transport: {
read: {
dataType: "json",
url: "api/items/getlocationitems?locationID=" + locationId
}
},
pageSize: 25
} :
{
data: [],
pageSize: 25
});
locationItems.setDataSource(dataSource);
locationItems.dataSource.read();
}
I am creating the grid via javascript. The datasource is connected directly to the webservice. An example of the webservice result is the following:
[ { col1: "",
col2: "",
Items: [ { ....} }
}]
Instead of using the main result like col1 and col2 I need to use the Items. How can I specify that using the example below?
var locationItems = $("#grid").kendoGrid({
columns: lockedGridColumns(),
height: 500,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
//reorderable: true,
//resizable: true,
autoBind: false
}).data("kendoGrid");
function getItems(locationId) {
if (locationId == null) {
locationId = 0;
}
var dataSource = new kendo.data.DataSource(locationId != 0 ?
{
transport: {
read: {
dataType: "json",
url: "api/items/getlocationitems?locationID=" + locationId
}
},
pageSize: 25
} :
{
data: [],
pageSize: 25
});
locationItems.setDataSource(dataSource);
locationItems.dataSource.read();
}