mirror of https://gitee.com/y_project/RuoYi.git
优化异步树表格折叠同步子状态
parent
d9fbae538b
commit
13fffa0ba8
|
@ -689,6 +689,7 @@
|
||||||
if (_isExpanded || _isCollapsed) {
|
if (_isExpanded || _isCollapsed) {
|
||||||
var tr = $(this).parent().parent();
|
var tr = $(this).parent().parent();
|
||||||
var row_id = tr.attr("id");
|
var row_id = tr.attr("id");
|
||||||
|
var row_pid = tr.attr("pid");
|
||||||
var _id = tr.attr("data-id");
|
var _id = tr.attr("data-id");
|
||||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
||||||
if (!options.pagination) {
|
if (!options.pagination) {
|
||||||
|
@ -717,18 +718,36 @@
|
||||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
||||||
if (_ls && _ls.length > 0) {
|
if (_ls && _ls.length > 0) {
|
||||||
if (_isExpanded) {
|
if (_isExpanded) {
|
||||||
$.each(_ls, function(index, item) {
|
if (row_pid == "row_root") {
|
||||||
$(item).css("display", "none");
|
$('table tr[id^="' + row_id + '_"]').css("display", "none");
|
||||||
});
|
$('table tr[id^="' + row_id + '_"]').each(function(i,n) {
|
||||||
|
var _isExpanded = $(n).find(".treetable-expander").hasClass(options.expanderExpandedClass);
|
||||||
|
if (_isExpanded) {
|
||||||
|
$(n).find(".treetable-expander").trigger("click");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$.each(_ls, function(index, item) {
|
||||||
|
$(item).css("display", "none");
|
||||||
|
var _isExpanded = $(item).find(".treetable-expander").hasClass(options.expanderExpandedClass);
|
||||||
|
if (_isExpanded) {
|
||||||
|
$(item).find(".treetable-expander").trigger("click");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$.each(_ls, function(index, item) {
|
if (row_pid == "row_root") {
|
||||||
var _icon = $(item).eq(options.expandColumn).find(".treetable-expander");
|
$('table tr[pid="' + row_id + '"]').css("display", "table");
|
||||||
if (_icon && _icon.hasClass(options.expanderExpandedClass)) {
|
} else {
|
||||||
$(item).css("display", "table");
|
$.each(_ls, function(index, item) {
|
||||||
} else {
|
var _p_icon = $("#" + $(item).attr("pid")).children().eq(options.expandColumn).find(".treetable-expander");
|
||||||
$(item).css("display", "table");
|
var _isExpanded = _p_icon.hasClass(options.expanderExpandedClass);
|
||||||
}
|
var _isCollapsed = _p_icon.hasClass(options.expanderCollapsedClass);
|
||||||
});
|
if (row_id == $(item).attr("pid")) {
|
||||||
|
$(item).css("display", "table");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (options.pagination) {
|
if (options.pagination) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue