feat: Blazor 模式下固定表头是增加高度动态调整功能
This commit is contained in:
parent
38134e2f0a
commit
ca3cbdc6e5
|
@ -135,7 +135,7 @@ nav .dropdown .nav-link-close.dropdown-toggle:after {
|
|||
}
|
||||
|
||||
.bootstrap-table .fixed-table-body {
|
||||
height: 300px;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.bootstrap-table .fixed-table-body table {
|
||||
|
|
|
@ -152,10 +152,26 @@
|
|||
$(header).width($(element).width());
|
||||
});
|
||||
},
|
||||
resetTableHeight(source) {
|
||||
var table = source;
|
||||
var height = 0;
|
||||
do {
|
||||
height += source.position().top;
|
||||
source = source.parent();
|
||||
if (source.hasClass('tab-content')) break;
|
||||
}
|
||||
while (source.length === 1);
|
||||
height = $(window).height() - height - 15;
|
||||
table.height(height);
|
||||
},
|
||||
initTable: function (id, firstRender) {
|
||||
var $table = $('#' + id);
|
||||
var $fixedBody = $table.parents('.fixed-table-body');
|
||||
|
||||
if (firstRender) {
|
||||
// calc height
|
||||
$.resetTableHeight($fixedBody);
|
||||
|
||||
// modify scroll
|
||||
$table.parent().overlayScrollbars({
|
||||
className: 'os-theme-dark',
|
||||
|
@ -175,6 +191,7 @@
|
|||
|
||||
$(window).on('resize', function () {
|
||||
$.resetTableWidth($table, $tableHeader);
|
||||
$.resetTableHeight($fixedBody);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue