jqGrid: how to copy a row?

2019-04-17 01:34发布

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.

标签: php jqgrid
1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-04-17 02:17

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.

查看更多
登录 后发表回答