3.2.0

Another one with delete

If have used your selecting from one grid and move to another, the user can select from a number of users and groups, and the selected lines are in grid2, and the users contained in 2 + groups are in grid3.
Whenever i have made a new selection i delete the contens of grid3, which is ok, the problem is that i keep getting the deleted rows from grid 2 when i move them to 3.

Confused ? me to.

Below is the function.

// move rows from target back to source
function toSource(){
var a = obj2.getSelectedRows();
for(i=0; i<a.length; i++){
obj1.addRow(myCells.length++);
obj1.setCellText(obj2.getCellText(0,a[i]),0,myCells.length-1)
obj1.setCellText(obj2.getCellText(1,a[i]),1,myCells.length-1)
obj1.setCellText(obj2.getCellText(2,a[i]),2,myCells.length-1)
obj1.setCellText(obj2.getCellText(3,a[i]),3,myCells.length-1)
obj2.deleteRow(a[i]);
}
count=obj3.getRowCount()
for(var i=count-1;i>0;i--) {
if (obj3.getCellText(0,i) == 'B')
obj3.deleteRow(i);
}
count=obj2.getRowCount();
count3=obj3.getRowCount()
for(var i=0;i<count;i++) {
if (obj2.getCellText(0,i)=='B') {
obj3.addRow(count3++);
obj3.setCellText(obj2.getCellText(0,i),0,count3-1)
obj3.setCellText(obj2.getCellText(1,i),1,count3-1)
obj3.setCellText(obj2.getCellText(2,i),2,count3-1)
obj3.setCellText(obj2.getCellText(3,i),3,count3-1)
}
else {
}
}

obj1.setSelectedRows([]);
obj2.setSelectedRows([]);

obj2.raiseEvent("adjustScrollBars");
}
Flaffer
July 16,
Please
Flaffer
July 22,

This topic is archived.

See also:


Back to support forum