ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: bsolteam on April 09, 2015, 06:49:50 pm
-
Hi Team,
Copy and Paste functionality is working very nice. But in my case this functionality should happen only for existing rows. It should not create new rows. In attached file 14 rows are already existed. If I copy 7 rows and pasted in last row it created 6 new rows. I want to restrict the creation of new rows. Is there any options to restrict the creation of new rows and paste only in existing rows.
Thanks in advance.
-
Please use beforeValidate event to process the pasted rows.
beforeValidate: function(evt, ui){
//debugger;
if(ui.source =='paste'){
var rowList = ui.rowList;
for(var i = rowList.length - 1 ; i >= 0 ; i-- ){
var rowL = rowList[i];
if(rowL.oldRow == null){
rowList.splice( i , 1 );
}
}
}
}
Example jsfiddle. http://jsfiddle.net/cjshzj8o/
-
Thanks heaps for your quick reply!