jqGrid:如何复制一行? [英] jqGrid: how to copy a row?

查看:94
本文介绍了jqGrid:如何复制一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jqGrid PHP.添加新行时(内联模式),如何使用与上次选择的行相同的单元格数据来预填充新行?非常感谢.

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.

推荐答案

您可以使用全局变量从onSelectRow事件中最后选择的行获取值.

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');

现在,在添加新行时,您可以像这样使用addRowData

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

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

您可以从lastsel变量中获取数据.

where data, you can get from lastsel var.

请参见 以供进一步参考.

See this for further reference.

这篇关于jqGrid:如何复制一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆