For new rows , users want to copy existing rows and modify them.
so I am adding new rows from existing rows selected.
There are 2 problems with this code:
1. New rows when modified, there are same entries in addList and updateList. - I want entry only in addList
2. When pasting is done on cell new rows , existing rows cells also show modified sign but they are modified. - I have no idea why that is happening.
Any help ?
function cloneRows() {
var arr = $grid.pqGrid("selection", { type: 'row', method: 'getSelection' });
console.log("getRowIndx");
console.log(arr);
if (arr && arr.length > 0) {
for (var index = 0; index < arr.length; index++) {
var foo = arr[index].rowData;
var clone = Object.assign({}, foo);
clone.Id = -index;
clone.pq_rowcls = 'yellow';
var addIndx = $grid.pqGrid("addRow", { rowIndx: index, rowData: clone, checkEditable: false });
console.log("addIndx");
console.log(addIndx);
}
$grid.pqGrid("setSelection", null);
$grid.pqGrid("refresh");
}
else {
alert("Select a row.");
return null;
}
}