jqGrid copy between grids -


i have page has 2 jqgrids on it. 1 contains list of available options, other contains list of included options. when page loaded each grid gets it's initial data server. after want user able move rows between grids until they're ready submit final result.

my code accomplish is:

function copyselected(fromgrid, togrid)     {         var grid = jquery(fromgrid);         var rowkey = grid.getgridparam("selrow");         if(rowkey != null)         {             var row = grid.jqgrid('getrowdata', rowkey);             grid.delrowdata(rowkey);             jquery(togrid).addrowdata(rowkey, row);         }     } 

the problem approach end duplicate rowids in destination grid. there way tell jqgrid create new id, or next free id?

you can use prefix ids destination grid:

jquery(togrid).addrowdata("bla_"+rowkey, row); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -