gpt4 book ai didi

jquery - jqgrid 中的验证

转载 作者:行者123 更新时间:2023-12-03 22:31:55 26 4
gpt4 key购买 nike

我目前正在使用 ci 框架开发 jqgrid。只是想问一下jqgrid中的验证。我已经看到在 jqgrid 中可以像这样验证列:editrules: {required:true}} 等等...

这是我的问题,我想知道如果客户输入他/她想要的用户名但它已经存在,是否有可能。使用 jqgrid 验证可以吗?

谢谢- 院长

最佳答案

您可以使用 custom edit rule 来执行此操作

这是文档中的示例

function mypricecheckforvalue(value, colname) {
if (value < 0 || value >20)
return [false,"Please enter value between 0 and 20"];
else
return [true,""];
}
jQuery("#grid_id").jqGrid({
...
colModel: [
...
{name:'price', ..., editrules:{custom:true, custom_func:mypricecheckforvalue....}, editable:true },
...
]
...
});

关于jquery - jqgrid 中的验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2004993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com