日期:2014-05-16  浏览次数:20378 次

jqGrid 添加、修改时怎么自定义验证和提示

如图
⒈红框内提示怎么改
⒉如何自定义验证方式(图中 密码 只能输入数字   只要设置number:true)
jquery jqGrid php

------解决方案--------------------
引用:
Quote: 引用:

wiki摘抄的,我没验证过,如果你没有试过的话,可以试一试

colModel: [ 
      ... 
      {name:'price', ..., editrules:{custom:true, custom_func:mypricecheck....}, editable:true },
      ...
]

···
function mypricecheck(value, colname) {
if (value < 0 
------解决方案--------------------
 value >20) 
   return [false,"Please enter value between 0 and 20"];
else 
   return [true,""];
}

custom_func:mypricecheck.... 这“点点点”是什么 还能这么调用的额?

...只是省略的意思,因为editrules里面还可以设置其他的属性,反正如果你要自定义验证的话下面的格式时必须的:editrules:{custom:true, custom_func:mypricecheck}