From 7cc6de6fb8f2a4dbbbf658ed0b205505af6766cd Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Wed, 10 Jul 2019 20:59:21 +0300 Subject: [PATCH] Add filter event --- src/components/datatable/DataTable.vue | 5 +++++ src/views/datatable/DataTableDoc.vue | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index b3a5c2a54..ceb063447 100644 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -474,6 +474,11 @@ export default { filteredValue = data; } + this.$emit('filter', { + filters: this.filters, + filteredValue: filteredValue + }); + return filteredValue; }, onRowClick(event, rowData, rowIndex) { diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index b6872a33e..a4e0fbc61 100644 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -928,14 +928,6 @@ export default { - - sort - event.originalEvent: Browser event.
- event.sortField: Field to sort against.
- event.sortOrder: Sort order as integer.
- event.multiSortMeta: MultiSort metadata. - Callback to invoke on sort. - page event.page: New page number
@@ -945,9 +937,18 @@ export default { Callback to invoke on pagination. + + sort + event.originalEvent: Browser event.
+ event.sortField: Field to sort against.
+ event.sortOrder: Sort order as integer.
+ event.multiSortMeta: MultiSort metadata. + Callback to invoke on sort. + filter - event.filters: Collection of active filters. + event.filters: Collection of active filters.
+ event.filteredValue: Filtered collection. Callback to invoke on filtering.