我怎样才能在jqgrid中验证

时间:2018-02-06 20:27:10

标签: jquery jqgrid jqgrid-asp.net mvcjqgrid

如果只保证字段为数字,如何保存我的保存按钮,显示消息?

--dontPublishCloudwatch

1 个答案:

答案 0 :(得分:0)

您可以使用内置验证。为此,您需要使用编辑规则。您可以在Guriddo jqGrid documentation.

找到更多内容

在你的情况下很简单:

{
    name: 'horaRegistro', index: 'horaRegistro', width: 0, editable: true, hidden: false, 
    edittype: 'text', 
    editoptions: {
        size: 15, 
        maxlengh: 10,
    },
    editrules : { 
       number : true
    }
},

您还可以设置最小最大值和其他限制。