mirror of https://github.com/layui/layui
修复 treeTable 开启了排序并且在 `done` 回调中执行了 `expandAll` 展开全部导致死循环问题
parent
c480f4928a
commit
9576df6908
|
@ -171,6 +171,11 @@ layui.define(['table'], function (exports) {
|
||||||
options.done = function () {
|
options.done = function () {
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
var doneThat = this;
|
var doneThat = this;
|
||||||
|
that.initSort = doneThat.initSort;
|
||||||
|
var isRenderData = args[3]; // 是否是 renderData
|
||||||
|
if (!isRenderData) {
|
||||||
|
delete that.isExpandAll;
|
||||||
|
}
|
||||||
|
|
||||||
var tableView = this.elem.next();
|
var tableView = this.elem.next();
|
||||||
that.updateStatus(null, {
|
that.updateStatus(null, {
|
||||||
|
@ -891,7 +896,9 @@ layui.define(['table'], function (exports) {
|
||||||
d[idKey] !== undefined && (that.status.expand[d[idKey]] = true);
|
d[idKey] !== undefined && (that.status.expand[d[idKey]] = true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (options.initSort && options.initSort.type && (!options.url || options.autoSort)) {
|
if (options.initSort && options.initSort.type &&
|
||||||
|
(!that.initSort || options.initSort.type !== that.initSort.type && options.initSort.field !== that.initSort.field) &&
|
||||||
|
(!options.url || options.autoSort)) {
|
||||||
return treeTable.sort(id);
|
return treeTable.sort(id);
|
||||||
}
|
}
|
||||||
var trAll = table.getTrHtml(id, tableDataFlat);
|
var trAll = table.getTrHtml(id, tableDataFlat);
|
||||||
|
|
Loading…
Reference in New Issue