0

I'm using jqGrid PHP. When adding a new row (inline mode), how can I pre fill the new row using the same cell data with the last selected row? Thanks so much.

Don Li
  • 1,095
  • 2
  • 12
  • 17

1 Answers1

5

You can use a global variable to get the values from last selected row in onSelectRow event like this.

var lastsel= jQuery('#grid').jqGrid('getGridParam','selrow');

Now while adding a new row you can use addRowData like this

$("#grid").addRowData(rowid,data, position, srcrowid);

where data, you can get from lastsel var.

See this for further reference.

Community
  • 1
  • 1
Piyush Sardana
  • 1,748
  • 4
  • 19
  • 33