- added CLEAR button to tables;
This commit is contained in:
@@ -128,6 +128,32 @@ const DraftApplicationsTableAsync = () => {
|
||||
</Link>
|
||||
}
|
||||
|
||||
const clearFilter = () => {
|
||||
setLazyState({
|
||||
first: 0,
|
||||
rows: 5,
|
||||
page: 0,
|
||||
sortField: null,
|
||||
sortOrder: null,
|
||||
filters: {
|
||||
id: { value: null, matchMode: 'contains' },
|
||||
callTitle: { value: null, matchMode: 'contains' },
|
||||
companyName: { value: null, matchMode: 'contains' },
|
||||
status: { value: null, matchMode: 'contains' }
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const renderHeader = () => {
|
||||
return (
|
||||
<div className="flex justify-content-between">
|
||||
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined onClick={clearFilter} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const header = renderHeader();
|
||||
|
||||
return (
|
||||
<div className="appPageSection__table">
|
||||
<DataTable
|
||||
@@ -136,6 +162,7 @@ const DraftApplicationsTableAsync = () => {
|
||||
first={lazyState.first} rows={lazyState.rows} totalRecords={totalRecordsNum} onPage={onPage}
|
||||
onSort={onSort} sortField={lazyState.sortField} sortOrder={lazyState.sortOrder}
|
||||
onFilter={onFilter} filters={lazyState.filters} loading={localAsyncRequest}
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}>
|
||||
<Column field="id" header={__('ID domanda', 'gepafin')}
|
||||
sortable
|
||||
|
||||
@@ -166,6 +166,32 @@ const LatestBandiTableAsync = () => {
|
||||
return getFormattedDateString(rowData.endDate) + ' ' + getTimeFromISOstring(endTimeObg);
|
||||
};
|
||||
|
||||
const clearFilter = () => {
|
||||
setLazyState({
|
||||
first: 0,
|
||||
rows: 5,
|
||||
page: 0,
|
||||
sortField: null,
|
||||
sortOrder: null,
|
||||
filters: {
|
||||
name: { value: null, matchMode: 'contains' },
|
||||
startDate: { value: null, matchMode: 'dateIs' },
|
||||
endDate: { value: null, matchMode: 'dateIs' },
|
||||
status: { value: null, matchMode: 'equals' }
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const renderHeader = () => {
|
||||
return (
|
||||
<div className="flex justify-content-between">
|
||||
<Button type="button" icon="pi pi-filter-slash" label={__('Pulisci', 'gepafin')} outlined onClick={clearFilter} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const header = renderHeader();
|
||||
|
||||
useEffect(() => {
|
||||
setLocalAsyncRequest(true);
|
||||
const paginationQuery = getPaginationQuery();
|
||||
@@ -181,6 +207,7 @@ const LatestBandiTableAsync = () => {
|
||||
first={lazyState.first} rows={lazyState.rows} totalRecords={totalRecordsNum} onPage={onPage}
|
||||
onSort={onSort} sortField={lazyState.sortField} sortOrder={lazyState.sortOrder}
|
||||
onFilter={onFilter} filters={lazyState.filters} loading={localAsyncRequest}
|
||||
header={header}
|
||||
emptyMessage={translationStrings.emptyMessage}>
|
||||
<Column field="name"
|
||||
sortable
|
||||
|
||||
Reference in New Issue
Block a user