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

解决方案 »

  1.   

    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,""];
    }
      

  2.   

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

  3.   

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

  4.   

    mypricecheck是你的方法名,任意取
      

  5.   

    jqGrid通用编辑规则,看自定义验证部分custom_func  function  custom设置为true时需要配置此函数。函数参数,输入控件的值,name名称(来自colModel)。 函数需要返回一个数组包含以下项目 第一项:true/false,指定验证是否成功 第二项:当第一项为false有效,显示给用户的错误信息。 格式如:[false,”Please enter valid value”]
      

  6.   

    Thank YOU  我网上找的也是这个 他写成了且{if (value < 0 && value >20) }出错了
      

  7.   

    嗯 function里面是你自己定义的验证代码,想怎么验证就怎么验证