mirror of https://gitee.com/karson/fastadmin.git
update public/assets/js/bootstrap-table-commonsearch.js.
新增字段配置以及默认首次渲染异常 Signed-off-by: 还俗二师兄 <505097558@qq.com>pull/527/head
parent
23919a8754
commit
eb74366381
|
|
@ -294,7 +294,7 @@
|
|||
var isAjax = typeof list === 'object' && typeof list.then === 'function';
|
||||
if (isFunction) {
|
||||
list = list();
|
||||
} else if (isAjax) {
|
||||
} else if (isAjax && vObjCol) {
|
||||
$.when(list).done(function (ret) {
|
||||
// 兼容旧版本在data中返回searchlist
|
||||
if (typeof ret.data.searchlist !== 'undefined') {
|
||||
|
|
@ -306,10 +306,12 @@
|
|||
$.each(list, function (key, val) {
|
||||
if (typeof val !== 'undefined' && val.constructor === Object) {
|
||||
key = val.id;
|
||||
val = val[vObjCol.nameKey || 'name'];
|
||||
vObjCol.nameKey = typeof vObjCol.nameKey === 'undefined' ? 'name' : vObjCol.nameKey
|
||||
val = val[vObjCol.nameKey];
|
||||
} else {
|
||||
key = isArray ? val : key;
|
||||
}
|
||||
vObjCol.defaultValue = typeof vObjCol.defaultValue === 'undefined' ? '' : vObjCol.defaultValue
|
||||
optionList.push(sprintf("<option value='" + Fast.api.escape(key) + "' %s>" + Fast.api.escape(val) + "</option>", key == vObjCol.defaultValue && vObjCol.defaultValue !='' ? 'selected' : ''));
|
||||
});
|
||||
$("form.form-commonsearch select[name='" + vObjCol.field + "']", that.$container).append(optionList.join('')).trigger("change");
|
||||
|
|
|
|||
Loading…
Reference in New Issue