diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue
index 506c87d40..f3fcac5d0 100644
--- a/src/components/datatable/DataTable.vue
+++ b/src/components/datatable/DataTable.vue
@@ -1818,6 +1818,7 @@ export default {
.p-datatable .p-column-title {
user-select: none;
+ vertical-align: middle;
}
.p-datatable .p-sortable-column {
diff --git a/src/views/datatable/DataTableDemo.vue b/src/views/datatable/DataTableDemo.vue
index cef38d44f..f9fe8ac18 100644
--- a/src/views/datatable/DataTableDemo.vue
+++ b/src/views/datatable/DataTableDemo.vue
@@ -10,27 +10,73 @@
-
Basic
-
-
-
-
-
-
-
-
Dynamic Columns
-
-
-
-
-
Styled
-
-
-
-
-
+
+
+ List of Cars
+
+
+
+
+
+
+ Vin
+ {{slotProps.data.vin}}
+
+
+
+
+
+
+
+ Year
+ {{slotProps.data.year}}
+
+
+
+
+
+
+
+ Brand
+
+ {{slotProps.data.brand}}
+
+
+
+
+
+
+
{{brandSlotProps.option.brand}}
+
+
+
+
+
+
+
+ Color
+ {{slotProps.data.color}}
+
+
+
+
+
+
+
+ Color
+ {{slotProps.data.color}}
+
+
+
+
+
+
+
+
+
@@ -48,23 +94,39 @@ import DataTableDoc from './DataTableDoc';
export default {
data() {
return {
- columns: null,
- cars: null
+ cars: null,
+ selectedCar: null,
+ filters: {},
+ brands: [
+ {brand: 'Audi', value: 'Audi'},
+ {brand: 'BMW', value: 'BMW'},
+ {brand: 'Fiat', value: 'Fiat'},
+ {brand: 'Honda', value: 'Honda'},
+ {brand: 'Jaguar', value: 'Jaguar'},
+ {brand: 'Mercedes', value: 'Mercedes'},
+ {brand: 'Renault', value: 'Renault'},
+ {brand: 'Volkswagen', value: 'Volkswagen'},
+ {brand: 'Volvo', value: 'Volvo'}
+ ],
+ colors: [
+ {name: 'White', value: 'White'},
+ {name: 'Green', value: 'Green'},
+ {name: 'Silver', value: 'Silver'},
+ {name: 'Black', value: 'Black'},
+ {name: 'Red', value: 'Red'},
+ {name: 'Maroon', value: 'Maroon'},
+ {name: 'Brown', value: 'Brown'},
+ {name: 'Orange', value: 'Orange'},
+ {name: 'Blue', value: 'Blue'}
+ ]
}
},
carService: null,
created() {
this.carService = new CarService();
-
- this.columns = [
- {field: 'vin', header: 'Vin'},
- {field: 'year', header: 'Year'},
- {field: 'brand', header: 'Brand'},
- {field: 'color', header: 'Color'}
- ];
},
mounted() {
- this.carService.getCarsSmall().then(data => this.cars = data);
+ this.carService.getCarsLarge().then(data => this.cars = data);
},
components: {
'DataTableDoc': DataTableDoc,
@@ -74,12 +136,55 @@ export default {