Skip to content

Commit a745c28

Browse files
committed
fix: CDataTable disable auto removing columnFilter
1 parent 5fd72b0 commit a745c28

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/table/CDataTable.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ const CDataTable = props => {
101101
return sorter && fields && fields[i].sorter !== false && isDataColumn
102102
}
103103

104-
const isFilterable = (colName, index) => {
105-
const haveEnabledFilter = (!fields || fields[index].filter !== false)
106-
return itemsDataColumns.includes(colName) && haveEnabledFilter
107-
}
108-
109104
const headerStyles = (index) => {
110105
let style = { verticalAlign: 'middle', overflow: 'hidden' }
111106
if (isSortable(index)) {
@@ -481,7 +476,7 @@ const CDataTable = props => {
481476
return (
482477
<th className={classNames(headerClass(index))} key={index}>
483478
{ columnFilterSlot[`${rawColumnNames[index]}`] ||
484-
( isFilterable(colName, index) &&
479+
( (!fields || fields[index].filter !== false) &&
485480
<input
486481
className="form-control form-control-sm"
487482
onInput={e=>{columnFilterEvent(colName, e.target.value, 'input')}}

0 commit comments

Comments
 (0)