Hi,
We have a window with 2 datagrids that allow select data from one grid to another. We have the four tipical options (add one, remove one, add all, remove all), our problem is in the "add all" option.
We need to clone the datasource from one grid to another and this is our try:
var gridAllData = $("gridAll").data("kendoGrid");
var gridSelectedData = $("gridSel").data("kendoGrid");
var ds = new kendo.data.DataSource();
gridSelectedData.setDataSource(ds);
var allData = gridAllData.dataSource.data();
var filters = gridAllData.dataSource.filter();
var query = new kendo.data.Query(allData);
var dataFilter = query.filter(filters).data;
for (var i=0; i < dataFilter.length; i++){
ds.add(dataFilter[i]);
}
gridSelectedData.pager.page(1);
gridSelectedData.dataSource.pageSize(10);
The problem is that it's very slow when there are many records. What is the best method to clone the datasource?