jqGrid:如何动态设置formoptions:elmsuffix? [英] jqGrid: How to set the formoptions:elmsuffix dynamically?

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

问题描述

我在我的密码字段中动态设置了必需的选项:

I set the required option to my password field dynamically:

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

工作正常.但是我不能设置elmsuffix:

And it work 's fine. But I can't set the elmsuffix:

$("#name").jqGrid('setColProp', 'password', {
    formoptions: {
        elmsuffix: ' *'
    }
});

我在做什么错了?

推荐答案

我想您的问题只是 where when 设置formoptions时.可能您试图在beforeShowForm内设置设置,但是在构造表单时应使用{formoptions: { elmsuffix: ' *' }设置.

I suppose that your problem is just where or when you set the formoptions. Probably you tried to set the settings inside of beforeShowForm, but the {formoptions: { elmsuffix: ' *' } setting should be used during constructing of the form.

因此,您应该只使用 beforeInitData 进行操作变化.

So you should just use beforeInitData to make the changes.

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

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