jquery.validate新增重置验证方法,将valid替换为resetValid用户体验会更好
This commit is contained in:
@@ -61,7 +61,7 @@ for (c in child.columnList){
|
|||||||
editable:true, edittype:'select', editoptions:{<%if (c.showType == 'select_multiple' || c.showType == 'checkbox'){ %>multiple:true, <% } %>'class':'form-control${cssClass}',
|
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']}')}),
|
items: $.merge([<%if (!(c.showType == 'select_multiple' || c.showType == 'checkbox')){ %>{dictLabel:' ',dictValue:''}<% } %>], \${@DictUtils.getDictListJson('${c.optionMap['dictType']}')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -166,9 +166,9 @@ $("#inputForm").validate({
|
|||||||
});
|
});
|
||||||
$('#corpCode_').change(function(){
|
$('#corpCode_').change(function(){
|
||||||
if ($('#loginCode').val() != ''){
|
if ($('#loginCode').val() != ''){
|
||||||
$('#loginCode').valid();
|
$('#loginCode').resetValid();
|
||||||
}else{
|
}else{
|
||||||
$('#loginCode').val('admin'+$(this).val()).valid();
|
$('#loginCode').val('admin'+$(this).val()).resetValid();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//加载角色列表
|
//加载角色列表
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ $("#empOfficeGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{postName:' ',postCode:''}], ${toJson(postList)}),
|
items: $.merge([{postName:' ',postCode:''}], ${toJson(postList)}),
|
||||||
itemLabel: 'postName', itemValue: 'postCode', dataInit: function(element){
|
itemLabel: 'postName', itemValue: 'postCode', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ $('#dataGrid').dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -142,7 +142,7 @@ $('#dataGrid').dataGrid({
|
|||||||
// editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
// editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
// items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
// items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
// itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
// itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
// $(element).select2().on("change",function(){$(this).valid()});
|
// $(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -271,7 +271,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -279,7 +279,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -287,7 +287,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -247,7 +247,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -255,7 +255,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -263,7 +263,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -220,7 +220,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -228,7 +228,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -236,7 +236,7 @@ $("#testDataChildDataGrid").dataGrid({
|
|||||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||||
$(element).select2().on("change",function(){$(this).valid()});
|
$(element).select2().on("change",function(){$(this).resetValid()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user