mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-09 09:56:40 +02:00
implement sticky headers
This commit is contained in:
parent
46b21b4a20
commit
00150bc9e1
|
@ -13,7 +13,7 @@
|
||||||
"array-bracket-spacing": 2,
|
"array-bracket-spacing": 2,
|
||||||
"keyword-spacing": ["error", { "after": true, "before": true }],
|
"keyword-spacing": ["error", { "after": true, "before": true }],
|
||||||
"max-depth": [2, 7],
|
"max-depth": [2, 7],
|
||||||
"max-statements": [2, 131],
|
"max-statements": [2, 133],
|
||||||
"complexity": [2, 41],
|
"complexity": [2, 41],
|
||||||
"no-unused-vars": 2,
|
"no-unused-vars": 2,
|
||||||
"no-eval": 2,
|
"no-eval": 2,
|
||||||
|
|
2
dist/tablefilter/style/tablefilter.css
vendored
2
dist/tablefilter/style/tablefilter.css
vendored
File diff suppressed because one or more lines are too long
2
dist/tablefilter/tablefilter.js
vendored
2
dist/tablefilter/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
2
dist/tablefilter/tablefilter.js.map
vendored
2
dist/tablefilter/tablefilter.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -859,6 +859,9 @@ export class TableFilter {
|
||||||
*/
|
*/
|
||||||
this.prfxResponsive = 'resp';
|
this.prfxResponsive = 'resp';
|
||||||
|
|
||||||
|
/** @private */
|
||||||
|
this.stickyCssClass = 'sticky';
|
||||||
|
|
||||||
/*** extensions ***/
|
/*** extensions ***/
|
||||||
/**
|
/**
|
||||||
* List of loaded extensions
|
* List of loaded extensions
|
||||||
|
@ -907,6 +910,12 @@ export class TableFilter {
|
||||||
*/
|
*/
|
||||||
this.toolbar = isObj(f.toolbar) || Boolean(f.toolbar);
|
this.toolbar = isObj(f.toolbar) || Boolean(f.toolbar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable sticky headers
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
|
this.stickyHeaders = Boolean(f.sticky_headers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Features registry
|
* Features registry
|
||||||
* @private
|
* @private
|
||||||
|
@ -1048,6 +1057,9 @@ export class TableFilter {
|
||||||
if (this.colWidths.length > 0) {
|
if (this.colWidths.length > 0) {
|
||||||
this.setFixedLayout();
|
this.setFixedLayout();
|
||||||
}
|
}
|
||||||
|
if (this.stickyHeaders && this.dom().tHead) {
|
||||||
|
addClass(this.dom().tHead, this.stickyCssClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load extensions */
|
/* Load extensions */
|
||||||
|
|
|
@ -32,6 +32,7 @@ div.helpCont
|
||||||
color #333
|
color #333
|
||||||
background #fff
|
background #fff
|
||||||
text-align left
|
text-align left
|
||||||
|
z-index 1000
|
||||||
|
|
||||||
a
|
a
|
||||||
color #cc0000
|
color #cc0000
|
||||||
|
|
|
@ -28,10 +28,16 @@ table.TF
|
||||||
border-bottom 1px solid $td-border-color
|
border-bottom 1px solid $td-border-color
|
||||||
text-overflow ellipsis
|
text-overflow ellipsis
|
||||||
|
|
||||||
// responsiveness
|
// responsive
|
||||||
&.resp
|
&.resp
|
||||||
display block
|
display block
|
||||||
overflow-x auto
|
overflow-x auto
|
||||||
|
|
||||||
.sort-arrow
|
.sort-arrow
|
||||||
position initial
|
position initial
|
||||||
|
|
||||||
|
// stick headers
|
||||||
|
thead.sticky
|
||||||
|
th
|
||||||
|
position sticky
|
||||||
|
top 0
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
},
|
},
|
||||||
btn_reset: true,
|
btn_reset: true,
|
||||||
status_bar: true,
|
status_bar: true,
|
||||||
|
sticky_headers: true,
|
||||||
msg_filter: 'Filtering...'
|
msg_filter: 'Filtering...'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,15 @@ var tfConfig = {
|
||||||
base_path: '../dist/tablefilter/',
|
base_path: '../dist/tablefilter/',
|
||||||
col_widths: [
|
col_widths: [
|
||||||
'150px', '100px', '100px',
|
'150px', '100px', '100px',
|
||||||
'70px', '70px', '70px',
|
'100px', '100px', '100px',
|
||||||
'70px', '60px', '60px'
|
'90px', '90px', '90px'
|
||||||
],
|
],
|
||||||
alternate_rows: true,
|
alternate_rows: true,
|
||||||
rows_counter: true,
|
rows_counter: true,
|
||||||
btn_reset: true,
|
btn_reset: true,
|
||||||
status_bar: true,
|
status_bar: true,
|
||||||
load_filters_on_demand: true,
|
load_filters_on_demand: true,
|
||||||
|
sticky_headers: true,
|
||||||
col_0: 'multiple',
|
col_0: 'multiple',
|
||||||
col_1: 'select',
|
col_1: 'select',
|
||||||
col_2: 'checklist'
|
col_2: 'checklist'
|
||||||
|
|
Loading…
Reference in a new issue