3.2.0

Moving Data from one grid to other grid

I have two datgird on the page. What i want to do is to move the selected data from one grid to other when the user clicks on a button
Shahzad
June 8,
You must had 2 arrays 1 per grid, just add the new data to the array of the 2nd grid and refresh. Set a function to add rows when a row is selected in the first grid.

obj is the first gird, MyData is the array of the first grid, obj2 is the second grid, MyData2 is the array of the second grid.

obj.setAction("selectionChanged", addRow);

function addRow(){
var index = obj.getProperty("selection/index");
var dataToAdd = [obj.getProperty("data/text", index, 0),
obj.getProperty("data/text", index, 1),
obj.getProperty("data/text", index, 2)
];
myData2.unshift(dataToAdd);
obj2.setRowProperty("count", myData2.length);
obj2.refresh();
}
Basking Rootwalla
June 8,
Thx, but i would also like to remove the data from the first grid. i used splice method to remove the data and data is removed but after this is done the paging does not work properly. When i want to move the last page it does not change the data and the error it shows is that myData is null ??
Shahzad
June 10,

This topic is archived.

See also:


Back to support forum