:: Forum >>

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
Tuesday, June 8, 2004
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
Tuesday, June 8, 2004
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
Thursday, June 10, 2004

This topic is archived.


Back to support forum

Forum search