2016-10-30 12:11:08 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
var bsa = new BootstrapAdmin({
|
|
|
|
|
url: '../api/Dicts',
|
|
|
|
|
dataEntity: new DataEntity({
|
|
|
|
|
map: {
|
|
|
|
|
ID: "dictID",
|
|
|
|
|
Category: "dictCate",
|
|
|
|
|
Name: "dictName",
|
2016-11-03 11:24:34 +08:00
|
|
|
|
Code: "dictCode",
|
|
|
|
|
Define:"dictDefine"
|
2016-10-30 12:11:08 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('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 },
|
2016-11-03 11:24:34 +08:00
|
|
|
|
{ title: "字典代码", field: "Code", sortable: true },
|
|
|
|
|
{ title: "字典定义", field: "Define", sortable: false }
|
2016-10-30 12:11:08 +08:00
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// validate
|
|
|
|
|
$('#dataForm').autoValidate({
|
|
|
|
|
dictCate: {
|
|
|
|
|
required: true,
|
|
|
|
|
maxlength: 50
|
|
|
|
|
},
|
|
|
|
|
dictName: {
|
|
|
|
|
required: true,
|
|
|
|
|
maxlength: 50
|
|
|
|
|
},
|
|
|
|
|
dictCode: {
|
|
|
|
|
required: true,
|
|
|
|
|
maxlength: 50
|
2016-11-03 11:24:34 +08:00
|
|
|
|
},
|
|
|
|
|
dictDefine: {
|
|
|
|
|
required: false,
|
|
|
|
|
maxlength: 50
|
2016-10-30 12:11:08 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
2016-10-29 16:46:02 +08:00
|
|
|
|
});
|