加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

删除时jQGrid主键问题

发布时间:2020-12-16 07:03:37 所属栏目:asp.Net 来源:网络整理
导读:我的行的主键是我的jQGrid中的隐藏字段.它被称为“UserId” colNames: ['UserId',"Details" ...],colModel: [{ name: 'UserId',index: 'UserId',editable: false,hidden: true },{ name: 'Details',index: 'Details',editable: true,editactioniconscolumn:
我的行的主键是我的jQGrid中的隐藏字段.它被称为“UserId”

colNames: ['UserId',"Details" ...],colModel: [{ name: 'UserId',index: 'UserId',editable: false,hidden: true },{ name: 'Details',index: 'Details',editable: true,editactioniconscolumn: true },...]

我得到了创建和更新案例,但我有删除问题

因为当删除时,我在控制器而不是UserId上获得网格行的Id,
我可以将所有UserId保存在网格ID中,这就是我目前正在做的删除工作,但我想知道是否有任何方法可以让我隐藏的UserId被发布而不是网格行ID.

解决方法

您可以通过多种方式实现您的要求:

>如果UserId列中的值在页面上是唯一的,并且可用于标识行,则可以将key:true属性添加到colModel中的UserId列定义.
>您可以使用beforeSubmit或onclickSubmit事件修改postdata参数并添加将发送到服务器的其他信息.有关示例,请参见here.
>使用delData属性,就像我在here中描述的editData一样.
>使用serializeDelData活动.见here和this.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读