3.2.0

Want to move all rows data from one grid to another grid.

I want to move all rows data from one grid to another grid onclick of button,

is there any functinality available for this?

how can i select all rows from grid??
we just have "gridobj.getCellText(text,col,row);" for cell text.

how to get all rows?
APP
July 2,
Here's an example Alex posted a while back. Its similar to what you want -
http://www.activewidgets.com/javascript.forum.13420.0/example-move-rows-between-two.html
Anthony
July 2,
Yes, as Anthony said, this is the example you must take as reference.
Just need a few adjusts to make it work with "all rows selected".

PLS Note that I removed obj1.deleteRow(a[i]); which is causing interferences for multiple rows selection and replaced with a single obj1.setRowIndices([]); to clear souce grid-rows, but need a few extra lines if you need to completely clean the source grid.

Note2 : does NOT work in opposite direction. Adjust the function toSource() in same way if needed.
function toTarget(){
//var a = obj1.getSelectedRows(); //REMOVED 
var a = obj1.getRowIndices(); //NEW

for(i=0; i<a.length; i++){
obj2.addRow(a[i]);
//  obj1.deleteRow(a[i]); //REMOVED
        }

obj1.setRowIndices([]); //NEW
obj2.setSelectedRows(a.concat());
obj1.setSelectedRows([]);

label.setControlText("Target: " + obj2.getRowIndices());
    }
Carlos
July 2,
thanks. its working now.
APP
July 3,

This topic is archived.

See also:


Back to support forum