jqgrid:字段是添加表单所必需的,但不是编辑表单所必需的? [英] jqgrid: Field required by add-form but not required by edit-form?

查看:101
本文介绍了jqgrid:字段是添加表单所必需的,但不是编辑表单所必需的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户具有密码,添加用户需要密码,但是在执行编辑操作时,不需要密码,但是可以更改密码.

an user has a password and it is required by add a user, but on edit-action a password is not required, but can be changed.

是否可以使用jqgrid做到这一点?

Is it possible to do this with jqgrid?

推荐答案

您可以更改此处).例如,您可以使用 setColProp 来执行此操作.例如,要在密码"中设置required: true,您可以调用

You can change the value of required property of the editrules inside of beforeShowForm (see here). You can use setColProp for example to do this. For example to set required: true in the 'password' you can call

$("#grid").jqGrid('setColProp', 'password', {editrules: {required: true}});

beforeShowForm内部.

这篇关于jqgrid:字段是添加表单所必需的,但不是编辑表单所必需的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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