mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
fix #1168
This commit is contained in:
parent
6d13a86512
commit
4a340c714b
@ -1,7 +1,13 @@
|
||||
export default ExtendBase =>
|
||||
class ColumnResolver extends ExtendBase {
|
||||
visibleColumnSize(includeSelectColumn = true) {
|
||||
let columnLen = this.props.columns.filter(c => !c.hidden).length;
|
||||
let columnLen;
|
||||
if (this.props.columnToggle && this.props.columnToggle.toggles) {
|
||||
const columns = this.props.columnToggle.toggles;
|
||||
columnLen = Object.keys(columns).filter(name => columns[name]).length;
|
||||
} else {
|
||||
columnLen = this.props.columns.filter(c => !c.hidden).length;
|
||||
}
|
||||
if (!includeSelectColumn) return columnLen;
|
||||
if (this.props.selectRow && !this.props.selectRow.hideSelectColumn) {
|
||||
columnLen += 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user