Fixed #181 - DataTable "$event" argument on page/sort events does not contains filterSearchMode.
parent
0007663991
commit
68a8af7cb8
|
@ -608,7 +608,7 @@ export default {
|
|||
}
|
||||
|
||||
let filterEvent = this.createLazyLoadEvent(event);
|
||||
filterEvent.filterValue = filteredValue;
|
||||
filterEvent.filteredValue = filteredValue;
|
||||
this.$emit('filter', filterEvent);
|
||||
|
||||
return filteredValue;
|
||||
|
@ -1598,15 +1598,25 @@ export default {
|
|||
}, this.virtualScrollDelay);
|
||||
},
|
||||
createLazyLoadEvent(event) {
|
||||
let filterMatchModes;
|
||||
if (this.hasFilters) {
|
||||
filterMatchModes = {};
|
||||
this.columns.forEach(col => {
|
||||
if (col.field) {
|
||||
filterMatchModes[col.field] = col.filterMatchMode;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
originalEvent: event,
|
||||
first: this.d_first,
|
||||
rows: this.d_rows,
|
||||
sortField: this.d_sortField,
|
||||
sortOrder: this.d_sortOrder,
|
||||
multiSortMeta: this.d_multiSortMeta,
|
||||
filters: this.filters,
|
||||
globalFilter: this.filters && this.filters['global'] ? this.filters['global'].value : null,
|
||||
multiSortMeta: this.d_multiSortMeta
|
||||
filterMatchModes: filterMatchModes
|
||||
};
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1970,45 +1970,45 @@ export default {
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>page</td>
|
||||
<td>event.page: New page number <br/>
|
||||
<td>event.originalEvent: Browser event <br >
|
||||
event.page: New page number <br/>
|
||||
event.pageCount: Total page count <br/>
|
||||
event.first: Index of first record <br/>
|
||||
event.rows: Number of rows to display in new page <br/>
|
||||
event.pageCount: Total number of pages <br />
|
||||
event.sortField: Field to sort against <br />
|
||||
event.sortOrder: Sort order as integer <br />
|
||||
event.multiSortMeta: MultiSort metadata <br />
|
||||
event.filters: Collection of active filters <br />
|
||||
event.filteredValue: Filtered collection
|
||||
event.filterMatchModes: Match modes per field
|
||||
</td>
|
||||
<td>Callback to invoke on pagination. Sort and Filter information is also available for lazy loading implementation.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sort</td>
|
||||
<td>event.page: New page number <br/>
|
||||
<td>event.originalEvent: Browser event <br >
|
||||
event.first: Index of first record <br/>
|
||||
event.rows: Number of rows to display in new page <br/>
|
||||
event.pageCount: Total number of pages <br />
|
||||
event.sortField: Field to sort against <br />
|
||||
event.sortOrder: Sort order as integer <br />
|
||||
event.multiSortMeta: MultiSort metadata <br />
|
||||
event.filters: Collection of active filters <br />
|
||||
event.filteredValue: Filtered collection
|
||||
event.filterMatchModes: Match modes per field
|
||||
</td>
|
||||
<td>Callback to invoke on sort. Page and Filter information is also available for lazy loading implementation.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>filter</td>
|
||||
<td>event.page: New page number <br/>
|
||||
<td>event.originalEvent: Browser event <br >
|
||||
event.first: Index of first record <br/>
|
||||
event.rows: Number of rows to display in new page <br/>
|
||||
event.pageCount: Total number of pages <br />
|
||||
event.sortField: Field to sort against <br />
|
||||
event.sortOrder: Sort order as integer <br />
|
||||
event.multiSortMeta: MultiSort metadata <br />
|
||||
event.filters: Collection of active filters <br />
|
||||
event.filteredValue: Filtered collection
|
||||
event.filteredValue: Filtered collection <br />
|
||||
event.filterMatchModes: Match modes per field
|
||||
</td>
|
||||
<td>Callback to invoke on filtering. Page and Sort information is also available for lazy loading implementation.</td>
|
||||
<td>Event to emit after filtering, not triggered in lazy mode.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>row-click</td>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<DataTable :value="cars" :filters="filters" :paginator="true" :rows="10">
|
||||
<template #header>
|
||||
<div style="text-align: right">
|
||||
<i class="pi pi-search" style="margin: 4px 4px 0px 0px;"></i>
|
||||
<i class="pi pi-search" style="margin: 4px 4px 0 0"></i>
|
||||
<InputText v-model="filters['global']" placeholder="Global Search" size="50" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<DataTable :value="cars" :filters="filters" :paginator="true" :rows="10">
|
||||
<template #header>
|
||||
<div style="text-align: right">
|
||||
<i class="pi pi-search" style="margin: 4px 4px 0px 0px;"></i>
|
||||
<i class="pi pi-search" style="margin: 4px 4px 0 0"></i>
|
||||
<InputText v-model="filters['global']" placeholder="Global Search" size="50" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue