增加字典变维护的客户端脚本验证
This commit is contained in:
parent
6123cc4e1b
commit
5fa5ee3a76
|
@ -1,33 +1,41 @@
|
|||
$(function () {
|
||||
var bsa = new BootstrapAdmin({
|
||||
url: '../api/Dicts',
|
||||
dataEntity: new DataEntity({
|
||||
map: {
|
||||
ID: "dictID",
|
||||
Category: "dictCate",
|
||||
Name: "dictName",
|
||||
Code: "dictCode"
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('table').smartTable({
|
||||
url: '../api/Dicts', //请求后台的URL(*)
|
||||
sortName: 'Category',
|
||||
queryParams: function (params) { return $.extend(params, { name: $("#txt_dict_name").val(), category: $("#txt_dict_cate").val() }); },
|
||||
columns: [{ checkbox: true },
|
||||
{ title: "Id", field: "ID", events: bsa.idEvents(), formatter: BootstrapAdmin.idFormatter },
|
||||
{ title: "字典种类", field: "Category", sortable: true },
|
||||
{ title: "字典名称", field: "Name", sortable: false },
|
||||
{ title: "字典代码", field: "Code", sortable: false }
|
||||
]
|
||||
});
|
||||
|
||||
// validate
|
||||
$('#dataForm').autoValidate({
|
||||
groupName: {
|
||||
required: true,
|
||||
maxlength: 50
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
var bsa = new BootstrapAdmin({
|
||||
url: '../api/Dicts',
|
||||
dataEntity: new DataEntity({
|
||||
map: {
|
||||
ID: "dictID",
|
||||
Category: "dictCate",
|
||||
Name: "dictName",
|
||||
Code: "dictCode"
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('table').smartTable({
|
||||
url: '../api/Dicts', //请求后台的URL(*)
|
||||
sortName: 'Category',
|
||||
queryParams: function (params) { return $.extend(params, { name: $("#txt_dict_name").val(), category: $("#txt_dict_cate").val() }); },
|
||||
columns: [{ checkbox: true },
|
||||
{ title: "Id", field: "ID", events: bsa.idEvents(), formatter: BootstrapAdmin.idFormatter },
|
||||
{ title: "字典种类", field: "Category", sortable: true },
|
||||
{ title: "字典名称", field: "Name", sortable: false },
|
||||
{ title: "字典代码", field: "Code", sortable: false }
|
||||
]
|
||||
});
|
||||
|
||||
// validate
|
||||
$('#dataForm').autoValidate({
|
||||
dictCate: {
|
||||
required: true,
|
||||
maxlength: 50
|
||||
},
|
||||
dictName: {
|
||||
required: true,
|
||||
maxlength: 50
|
||||
},
|
||||
dictCode: {
|
||||
required: true,
|
||||
maxlength: 50
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue