|
@@ -128,7 +128,11 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|
|
});
|
|
|
$(form).on("reset", function () {
|
|
|
setTimeout(function () {
|
|
|
- $('.selectpage', form).selectPageClear();
|
|
|
+ $(".selectpage", form).each(function () {
|
|
|
+ var selectpage = $(this).data("selectPageObject");
|
|
|
+ selectpage.elem.hidden.val($(this).val());
|
|
|
+ $(this).selectPageRefresh();
|
|
|
+ });
|
|
|
}, 1);
|
|
|
});
|
|
|
}
|
|
@@ -361,6 +365,12 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|
|
return obj;
|
|
|
};
|
|
|
var fieldlist = $(".fieldlist", form);
|
|
|
+ //表单重置
|
|
|
+ form.on("reset", function () {
|
|
|
+ setTimeout(function () {
|
|
|
+ fieldlist.trigger("fa.event.refreshfieldlist");
|
|
|
+ });
|
|
|
+ });
|
|
|
//监听文本框改变事件
|
|
|
$(document).on('change keyup changed', ".fieldlist input,.fieldlist textarea,.fieldlist select", function () {
|
|
|
var container = $(this).closest(".fieldlist");
|
|
@@ -478,6 +488,11 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|
|
if ($("[data-role='tagsinput']", form).length > 0) {
|
|
|
require(['tagsinput', 'autocomplete'], function () {
|
|
|
$("[data-role='tagsinput']").tagsinput();
|
|
|
+ form.on("reset", function () {
|
|
|
+ setTimeout(function () {
|
|
|
+ $("[data-role='tagsinput']").tagsinput('reset');
|
|
|
+ }, 0);
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -505,7 +520,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|
|
'==': function(a, b) { return a == b; },
|
|
|
'!=': function(a, b) { return a != b; },
|
|
|
'in': function(a, b) { return b.split(/\,/).indexOf(a) > -1; },
|
|
|
- 'regex': function(a, b) {
|
|
|
+ 'regex': function (a, b) {
|
|
|
var regParts = b.match(/^\/(.*?)\/([gim]*)$/);
|
|
|
var regexp = regParts ? new RegExp(regParts[1], regParts[2]) : new RegExp(b);
|
|
|
return regexp.test(a);
|