From 5654ccb6215576cc38b3a4cc3fa8a02912054bc3 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Tue, 15 Jun 2021 10:50:58 +0800 Subject: [PATCH] =?UTF-8?q?dataGrid=E5=AD=90=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E9=80=89=E6=A1=86=E5=92=8C=E5=A4=8D=E9=80=89=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/gen/include/formChildTableScript.html | 12 ++++++++---- .../views/modules/sys/user/empUserForm.html | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html index 24f312a6..96486085 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html @@ -58,10 +58,14 @@ for (c in child.columnList){ }else if(c.showType == 'select' || c.showType == 'select_multiple' || c.showType == 'radio' || c.showType == 'checkbox'){ %> {header:'\${text("${c.columnLabel}")}', name:'${c.attrName}', width:100, - editable:true, edittype:'select', editoptions:{<%if (c.showType == 'select_multiple' || c.showType == 'checkbox'){ %>multiple:true, <% } %>'class':'form-control${cssClass}', - items: $.merge([<%if (!(c.showType == 'select_multiple' || c.showType == 'checkbox')){ %>{dictLabel:' ',dictValue:''}<% } %>], \${@DictUtils.getDictListJson('${c.optionMap['dictType']}')}), + editable:true, edittype:'${c.showType == "select_multiple" ? "select" : c.showType}', editoptions:{<%if (c.showType == 'select_multiple' || c.showType == 'checkbox'){ %>multiple:true, <% } %>'class':'form-control${cssClass}<%if (c.showType == "radio" || c.showType == "checkbox"){ %> icheck<% } %>', + items: $.merge([<%if (c.showType == 'select'){ %>{dictLabel:' ',dictValue:''}<% } %>], \${@DictUtils.getDictListJson('${c.optionMap['dictType']}')}), itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){ - $(element).select2().on("change",function(){$(this).resetValid()}); + <%if (c.showType == "radio" || c.showType == "checkbox"){ %> + js.iCheck(element).on("ifChanged",function(){$(this).resetValid()}); + <% }else{ %> + js.select2(element).on("change",function(){$(this).resetValid()}); + <% } %> } } }, @@ -135,7 +139,7 @@ for (c in child.columnList){ } if (table.tplCategory != 'query'){ %> - {header:'\${text("操作")}', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){ + {header:'\${text("操作")}', name:'actions', width:80, align:'center', formatter: function(val, obj, row, act){ var actions = []; if (val == 'new'){ actions.push(' '); diff --git a/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html b/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html index 73d900ee..cc0137e7 100644 --- a/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html +++ b/modules/core/src/main/resources/views/modules/sys/user/empUserForm.html @@ -241,7 +241,7 @@ $("#empOfficeGrid").dataGrid({ editable:true, edittype:'select', editoptions:{'class':'form-control', items: $.merge([{postName:' ',postCode:''}], ${toJson(postList)}), itemLabel: 'postName', itemValue: 'postCode', dataInit: function(element){ - $(element).select2().on("change",function(){$(this).resetValid()}); + js.select2(element).on("change",function(){$(this).resetValid()}); } } },