This is a migrated thread and some comments may be shown as answers.

[Solved] kendo dataSource.transport.parameterMap undefined when data is not returned by transport

1 Answer 838 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Enio
Top achievements
Rank 1
Enio asked on 01 Dec 2014, 05:55 PM
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!

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 03 Dec 2014, 12:05 PM
Hi Enio,

I'm afraid that the LocalTransport which is instantiated in the scenario you have described, does not have parameterMap. This is due to the fact that it does not need one as there is no need to serialize the DataSource state or to send parameters when working with data in-memory.

In order to serialize the DataSource state in the format which to be read by the DataSourceRequest model binder you will need to use the aspnetmvc specific transport parameterMap as shown in this How-to project.
 
Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Enio
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or