From 5fa5ee3a76be0b5692c2283db49bc083f5c958ec Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Sun, 30 Oct 2016 12:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E5=85=B8=E5=8F=98?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E7=9A=84=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Scripts/Dicts.js | 72 ++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/Bootstrap.Admin/Scripts/Dicts.js b/Bootstrap.Admin/Scripts/Dicts.js index 200e67d5..bffef6a4 100644 --- a/Bootstrap.Admin/Scripts/Dicts.js +++ b/Bootstrap.Admin/Scripts/Dicts.js @@ -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 + } + }); }); \ No newline at end of file