Skip to content

Commit cfc009d

Browse files
committed
优化固定列高度计算
1 parent 4359aa4 commit cfc009d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

dist/extensions/fixed-columns/bootstrap-table-fixed-columns.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@
292292
if (typeof that.options.height !== 'undefined') paginationHeight = 0;
293293
var height = that.$tableContainer.outerHeight(true) - scrollHeight - paginationHeight + 1;
294294
$fixedColumns.css({
295-
height: height
295+
height: height,
296+
"min-height": "calc(100% - " + (paginationHeight + scrollHeight) + "px)"
296297
});
297-
298298
$fixedBody.css({
299-
height: height - $fixedHeader.height()
299+
height: height - $fixedHeader.height(),
300+
"min-height": "calc(100% - " + $fixedHeader.height() + "px)",
301+
overflow: "hidden"
300302
});
301303

302304
return $fixedBody;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fastadmin-bootstraptable",
33
"description": "An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3).",
4-
"version": "1.11.6",
4+
"version": "1.11.7",
55
"main": "./dist/bootstrap-table.js",
66
"devDependencies": {
77
"cz-conventional-changelog": "^1.1.5",

src/extensions/fixed-columns/bootstrap-table-fixed-columns.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@
292292
if (typeof that.options.height !== 'undefined') paginationHeight = 0;
293293
var height = that.$tableContainer.outerHeight(true) - scrollHeight - paginationHeight + 1;
294294
$fixedColumns.css({
295-
height: height
295+
height: height,
296+
"min-height": "calc(100% - " + (paginationHeight + scrollHeight) + "px)"
296297
});
297-
298298
$fixedBody.css({
299-
height: height - $fixedHeader.height()
299+
height: height - $fixedHeader.height(),
300+
"min-height": "calc(100% - " + $fixedHeader.height() + "px)",
301+
overflow: "hidden"
300302
});
301303

302304
return $fixedBody;

0 commit comments

Comments
 (0)