修复autocomplete选中后未触发验证的问题

修复Table.api.formatter.file无法渲染的问题
pull/474/head
Karson 2024-06-18 16:05:57 +08:00
parent 18a661fb22
commit 03ccce86f0
2 changed files with 6 additions and 2 deletions

View File

@ -521,7 +521,11 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
autocomplete: function (form) { autocomplete: function (form) {
if ($("[data-role='autocomplete']", form).length > 0) { if ($("[data-role='autocomplete']", form).length > 0) {
require(['autocomplete'], function () { require(['autocomplete'], function () {
$("[data-role='autocomplete']").autocomplete(); $("[data-role='autocomplete']").autocomplete({
onSelect: function () {
$(this).trigger('change').trigger('validate');
}
});
}); });
} }
}, },

View File

@ -751,7 +751,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
return html.join(' '); return html.join(' ');
}, },
file: function (value, row, index) { file: function (value, row, index) {
Table.api.formatter.files.call(this, value, row, index); return Table.api.formatter.files.call(this, value, row, index);
}, },
files: function (value, row, index) { files: function (value, row, index) {
value = value == null || value.length === 0 ? '' : value.toString(); value = value == null || value.length === 0 ? '' : value.toString();