Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Commit 41392c6

Browse files
authored
Merge pull request #100 from tarunsamanta2k20/tarun_samanta/#98
Added functionality for clearing filters applied on tables.
2 parents f0588e3 + 1e762ae commit 41392c6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • frontend/src/components/dbfragments/table

frontend/src/components/dbfragments/table/table.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useAppDispatch } from '../../../redux/hooks'
1010
import { deleteDBData, setQueryData, updateDBSingleData } from '../../../redux/dataModelSlice'
1111
import { DBConnType } from '../../../data/defaults'
1212
import TabContext from '../../layouts/tabcontext'
13+
import { filter } from 'lodash'
1314

1415

1516
type TablePropType = {
@@ -162,6 +163,11 @@ const Table = ({ queryData, dbConnection, mSchema, mName, isEditable, showHeader
162163
}
163164
onFilterChanged(filter)
164165
}
166+
const onFilterClear = () =>{
167+
let filter: string[] | undefined = undefined
168+
setFilterValue(['default', 'default', '']);
169+
onFilterChanged(filter);
170+
}
165171

166172
const changeSort = (newSortIdx: string) => {
167173
if (!isEditable) {
@@ -228,6 +234,9 @@ const Table = ({ queryData, dbConnection, mSchema, mName, isEditable, showHeader
228234
<p className="control">
229235
<button className="button" onClick={onFilter}>Filter</button>
230236
</p>
237+
<p className="control">
238+
<button className="button" onClick={onFilterClear} >Clear Filter</button>
239+
</p>
231240
</div>
232241
</div>
233242
{isEditable && <React.Fragment>

0 commit comments

Comments
 (0)