# Kendo grid optimization

I have two kendoGrid(s) named:

var sourcegrid = $('#usersGrid').data("kendoGrid"); //SOURCE GRID var destinationgrid =$('#teamGrid').data('kendoGrid');    //DESTINATION GRID


In sourcegrid, I have 1000 records and in destinationgrid has no records.

I have a button that transfers data from sourcegrid to destinationgrid.

 sourcegrid.select().each(function () {
var dataItem = sourcegrid.dataItem($(this)); destinationgrid.dataSource.add(dataItem); sourcegrid.removeRow($(this));
});


When I'm transferring 500 records to destinationgrid, the process of transferring is so slow. How can this be optimized?

You can use this jsfiddle.net link here.

• Welcome to CodeReview, hope you get some good answers! – Abbas Jan 7 '15 at 10:14

## Capitalisation:

If you're gonna use variables like this: kendoGrid, dataItem, but then have variables like: destinationgrid and sourcegrid, then stick with one (preferably the first, because it's easier to read)

## Optimizing:

It seemed for me, that removing this line increased the speed:

editable: "popup",

Because with your code it popups for each data cell being removed, which is fine, if that's what you want

However, it seems with your code that it doesn't support the movement of more than one data cell at a time.

## Note:

If you're wanting the user to select more than one nearly every time, then using popups is fine, but make it one popup per action.

• just ignore the popup and blank data when passing to destinationgrid. the issue when selecting all records and pass it to destinationgrid. the browser hang/stopped. – nojla Jan 7 '15 at 13:52