From 7b2f6a001683537df1fdb51c56c446535e80ee13 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Wed, 3 Jul 2019 17:58:25 +0300 Subject: [PATCH] Selection events --- .../datatable/DataTableSelectionDemo.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/views/datatable/DataTableSelectionDemo.vue b/src/views/datatable/DataTableSelectionDemo.vue index 08d93d35c..daea4af45 100644 --- a/src/views/datatable/DataTableSelectionDemo.vue +++ b/src/views/datatable/DataTableSelectionDemo.vue @@ -41,6 +41,16 @@ + +

Events

+

row-select and row-unselects are available as selection events.

+ + + + + + @@ -57,6 +67,7 @@ export default { return { cars: null, selectedCar1: null, + selectedCar2: null, selectedCars1: null, selectedCars2: null } @@ -68,6 +79,14 @@ export default { mounted() { this.carService.getCarsSmall().then(data => this.cars = data); }, + methods: { + onRowSelect(event) { + this.$toast.add({severity: 'info', summary: 'Car Selected', detail: 'Vin: ' + event.data.vin, life: 3000}); + }, + onRowUnselect(event) { + this.$toast.add({severity: 'warn', summary: 'Car Unselected', detail: 'Vin: ' + event.data.vin, life: 3000}); + } + }, components: { 'DataTableDoc': DataTableDoc, 'DataTableSubMenu': DataTableSubMenu