I'm trying to send filtering data of grid to controller to export data to excel.But I already have the data and I don't need to do a request to get it on client side, I'm filling the grid as the following code:
var dataSource = new kendo.data.DataSource({
data: result.Data,
pageSize: 25
});
$("#grid").kendoGrid({
autoBind: false,
columns: result.Columns,
dataSource: dataSource,
sortable: true,
filterable: true,
resizable: true
});
When I try to get the parameters, i can't because it doesn't exists
var grid = $("#grid").data('kendoGrid');
var parameters = grid.dataSource.transport.parameterMap({
filter: grid.dataSource.filter(),
page: grid.dataSource.page(),
pageSize: grid.dataSource.pageSize(),
sort: grid.dataSource.sort(),
group: grid.dataSource.group()
})
I get an error: Uncaught TypeError: undefined is not a function
If I try to serialize parametersMap without the function grid.dataSource.transport.parameterMap, its serialization occur in a wrong form and the MVC controller parameter can't get the filter value.But if I set a read URL on transport property of dataSource it works perfectly.
So, does anyone knows how to obtain parameterMap without have a read function on transport property ?
Regards!
var dataSource = new kendo.data.DataSource({
data: result.Data,
pageSize: 25
});
$("#grid").kendoGrid({
autoBind: false,
columns: result.Columns,
dataSource: dataSource,
sortable: true,
filterable: true,
resizable: true
});
When I try to get the parameters, i can't because it doesn't exists
var grid = $("#grid").data('kendoGrid');
var parameters = grid.dataSource.transport.parameterMap({
filter: grid.dataSource.filter(),
page: grid.dataSource.page(),
pageSize: grid.dataSource.pageSize(),
sort: grid.dataSource.sort(),
group: grid.dataSource.group()
})
I get an error: Uncaught TypeError: undefined is not a function
If I try to serialize parametersMap without the function grid.dataSource.transport.parameterMap, its serialization occur in a wrong form and the MVC controller parameter can't get the filter value.But if I set a read URL on transport property of dataSource it works perfectly.
So, does anyone knows how to obtain parameterMap without have a read function on transport property ?
Regards!