Jsgrid字段“必填”;内部对话不起作用
jsgrid field "required" inside dialog doesn't work
我想将name: "Name"
设置为required
,我根据jsgrid文档(http://js-grid.com/docs/#grid-fields)插入:validate: "required"
,但它不起作用。
当插入validate: "required"
在我下面的代码为jsgrid字段:Name
jsgrid不采取所需的限制和插入块!!我几乎可以肯定,由于validate
是一个参数,可以在dialog和jsgrid中定义,因此我将网格包含在对话框中会产生问题。
这是dialog的代码,其中我成功地在一个对话框中显示我的网格,但我不能通过validate:"required"。我还上传了一个screenshotGrid在对话框:
$( "#DataGrid" ).dialog({minWidth: 1000, minHeight: 500});
$("#DataGrid").jsGrid({
height: "100%",
width: "70%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
datatype: "json",
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Id", align: "center", width: 45 },
{ name: "Name", validate:"required," align: "center", type: "text", width: 45 },
{ name: "Displayed Name(locale)", align: "center", type: "text", width: 40 },
{ name: "Data Type", align: "center", type: "select", items: db.dataType, valueField: "Id", textField: "Name", width: 40 },
{ name: "Initial Value", align: "center", type: "text", width: 40 },
{ name: "Initial State", align: "center", type: "select", items: db.initialState, valueField: "Id", textField: "Name", width: 50 },
{ name: "Worklist Order", align: "center", type: "number", width: 20 },
{ name: "DB Datatype", align: "center", type: "text", width: 25 },
{ name: "Allowed Values JSON", align: "center", type: "text", width: 20 },
{ name: "Allowed Values SQL", align: "center", type: "text", width: 20 },
{ type: "control", width: 25 }
]
});
我尝试了没有对话框的jsgrid代码,它的工作原理,但它将如何在对话框内工作?这段没有对话框的代码可以工作:
$("#DataGrid").jsGrid({
height: "100%",
width: "70%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
datatype: "json",
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Id", align: "center", width: 45 },
{ name: "Name", validate:"required", align: "center", type: "text", width: 45 },
{ name: "Displayed Name(locale)", align: "center", type: "text", width: 40 },
{ name: "Data Type", align: "center", type: "select", items: db.dataType, valueField: "Id", textField: "Name", width: 40 },
{ name: "Initial Value", align: "center", type: "text", width: 40 },
{ name: "Initial State", align: "center", type: "select", items: db.initialState, valueField: "Id", textField: "Name", width: 50 },
{ name: "Worklist Order", align: "center", type: "number", width: 20 },
{ name: "DB Datatype", align: "center", type: "text", width: 25 },
{ name: "Allowed Values JSON", align: "center", type: "text", width: 20 },
{ name: "Allowed Values SQL", align: "center", type: "text", width: 20 },
{ type: "control", width: 25 }
]
});
有什么想法吗?这是一个复杂的问题。
在@tabalin的帮助下,我解决了这个问题。我少了一个jsgrid存档。现在它就像一个魅力!
相关文章:
- 内部分区字体大小获胜'调整浏览器窗口大小时不会随媒体查询而更改
- 着色引导框对话框
- 调用函数内部的函数
- 如何使用js将SNAPSHOT内部版本号转换为3位数的整数
- 文本框不是从Javascript/Asp.net中的对话框中打印出来的
- 在phonegap应用程序内部重定向不起作用
- 使用此选项选择父类内部的类
- CKeditor:更改对话框中的默认选择选项
- 访问JSON对象内部的数组元素
- 从模块内部访问Express装载路径
- AngularJs指令,该指令创建内部有数据对象的新指令
- 如何使用内部对象构造对象
- 根据选项卡内部的文本链接中的哈希ID动态选择jqueryUI选项卡
- 搜索api在mac上显示对话框
- 使用密码对话框Javascript请求帮助
- 用Javascript修改内部标记的CSS规则
- CKEditor v4:自制插件中对话框的动态标题
- 如何在对话框内部内容增加时将按钮固定到jQueryUI对话框底部
- 从iframe内部关闭XPages ExtLib对话框
- Jsgrid字段“必填”;内部对话不起作用