-
+
@@ -126,8 +128,10 @@ const sizeOptions = ref([
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/StatefulDoc.vue b/doc/datatable/StatefulDoc.vue
index a99954f8e..eca2c339a 100644
--- a/doc/datatable/StatefulDoc.vue
+++ b/doc/datatable/StatefulDoc.vue
@@ -6,76 +6,78 @@
browser is closed. Other alternative is
local referring to
localStorage for an extended lifetime.
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
{{ data.country.name }}
-
-
-
-
-
-
-
-
-
-
-
{{ data.representative.name }}
-
-
-
-
-
-
-
-
{{ slotProps.option.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No customers found.
-
-
+
+
+
+
+
+
+
+
+
+
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
{{ data.representative.name }}
+
+
+
+
+
+
+
+
{{ slotProps.option.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No customers found.
+
+
+
@@ -433,10 +435,10 @@ const getSeverity = (status) => {
created() {
this.initFilters();
},
- mounted() {
- CustomerService.getCustomersSmall().then((data) => (this.customers = data));
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersSmall().then((data) => (this.customers = data));
+ },
initFilters() {
this.filters = {
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
diff --git a/doc/datatable/StripedRowsDoc.vue b/doc/datatable/StripedRowsDoc.vue
index ea63be2f0..b02fbc644 100644
--- a/doc/datatable/StripedRowsDoc.vue
+++ b/doc/datatable/StripedRowsDoc.vue
@@ -2,14 +2,16 @@
Alternating rows are displayed when stripedRows property is present.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -98,8 +100,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/TemplateDoc.vue b/doc/datatable/TemplateDoc.vue
index 3172acbbd..94ab4c505 100644
--- a/doc/datatable/TemplateDoc.vue
+++ b/doc/datatable/TemplateDoc.vue
@@ -2,39 +2,41 @@
Custom content at header and footer sections are supported via templating.
-
-
-
-
- Products
-
-
-
-
-
-
-
+
+
+
+
+
+ Products
+
+
-
-
-
- {{ formatCurrency(slotProps.data.price) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- In total there are {{ products ? products.length : 0 }} products.
-
-
+
+
+
+
+
+
+
+
+ {{ formatCurrency(slotProps.data.price) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ In total there are {{ products ? products.length : 0 }} products.
+
+
+
@@ -236,10 +238,10 @@ const getSeverity = (product) => {
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
formatCurrency(value) {
return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
},
diff --git a/doc/datatable/colresize/ExpandModeDoc.vue b/doc/datatable/colresize/ExpandModeDoc.vue
index 6398161c9..fae264a12 100644
--- a/doc/datatable/colresize/ExpandModeDoc.vue
+++ b/doc/datatable/colresize/ExpandModeDoc.vue
@@ -2,14 +2,16 @@
Setting columnResizeMode as expand changes the table width as well.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -96,8 +98,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/colresize/FitModeDoc.vue b/doc/datatable/colresize/FitModeDoc.vue
index d1f15badb..5e597ee8d 100644
--- a/doc/datatable/colresize/FitModeDoc.vue
+++ b/doc/datatable/colresize/FitModeDoc.vue
@@ -5,14 +5,16 @@
that does not change the overall table width.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -99,8 +101,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/edit/CellEditDoc.vue b/doc/datatable/edit/CellEditDoc.vue
index f7c3b6f4c..71bfed66c 100644
--- a/doc/datatable/edit/CellEditDoc.vue
+++ b/doc/datatable/edit/CellEditDoc.vue
@@ -2,35 +2,37 @@
Cell editing is enabled by setting editMode as cell , defining input elements with editor templating of a Column and implementing cell-edit-complete to update the state.
-
-
-
-
- {{ field === 'price' ? formatCurrency(data[field]) : data[field] }}
-
-
-
-
+
+
+
+
+
+ {{ field === 'price' ? formatCurrency(data[field]) : data[field] }}
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
@@ -260,10 +262,10 @@ const formatCurrency = (value) => {
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
onCellEditComplete(event) {
let { data, newValue, field } = event;
diff --git a/doc/datatable/edit/FilterSortEditDoc.vue b/doc/datatable/edit/FilterSortEditDoc.vue
index 3297687ba..82a60b5b8 100644
--- a/doc/datatable/edit/FilterSortEditDoc.vue
+++ b/doc/datatable/edit/FilterSortEditDoc.vue
@@ -2,32 +2,34 @@
Cell Editing with Sorting and Filter
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -271,10 +273,10 @@ const isPositiveInteger = (val) => {
{ field: 'price', header: 'Price' }
];
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
onCellEditComplete(event) {
let { data, newValue, field } = event;
diff --git a/doc/datatable/edit/RowEditDoc.vue b/doc/datatable/edit/RowEditDoc.vue
index 3a407d990..b29886724 100644
--- a/doc/datatable/edit/RowEditDoc.vue
+++ b/doc/datatable/edit/RowEditDoc.vue
@@ -5,55 +5,57 @@
editor slot of a Column and implementing
row-edit-save are necessary to update the state. The column to control the editing state should have
editor templating applied.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ formatCurrency(data[field]) }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatCurrency(data[field]) }}
+
+
+
+
+
+
+
+
+
@@ -77,7 +79,7 @@ export default {
table: { style: 'min-width: 50rem' },
column: {
bodycell: ({ state }) => ({
- style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
+ style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
})
}
}"
@@ -123,7 +125,7 @@ export default {
table: { style: 'min-width: 50rem' },
column: {
bodycell: ({ state }) => ({
- style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
+ style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
})
}
}"
@@ -217,7 +219,7 @@ export default {
table: { style: 'min-width: 50rem' },
column: {
bodycell: ({ state }) => ({
- style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
+ style: state['d_editing']&&'padding-top: 0.6rem; padding-bottom: 0.6rem'
})
}
}"
@@ -317,10 +319,10 @@ const formatCurrency = (value) => {
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
onRowEditSave(event) {
let { newData, index } = event;
diff --git a/doc/datatable/filter/AdvancedFilterDoc.vue b/doc/datatable/filter/AdvancedFilterDoc.vue
index d79d746a5..99e11393f 100644
--- a/doc/datatable/filter/AdvancedFilterDoc.vue
+++ b/doc/datatable/filter/AdvancedFilterDoc.vue
@@ -2,116 +2,118 @@
When filterDisplay is set as menu , filtering is done via popups with support for multiple constraints and advanced templating.
-
-
-
-
-
-
-
-
-
-
-
- No customers found.
- Loading customers data. Please wait.
-
-
- {{ data.name }}
-
-
-
-
-
-
-
-
-
-
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- Customized Buttons
-
-
-
-
-
-
-
{{ data.representative.name }}
-
-
-
-
-
-
-
-
{{ slotProps.option.name }}
-
-
-
-
-
-
-
- {{ formatDate(data.date) }}
-
-
-
-
-
-
-
- {{ formatCurrency(data.balance) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ filterModel.value ? filterModel.value[0] : 0 }}
- {{ filterModel.value ? filterModel.value[1] : 100 }}
-
-
-
-
-
-
-
-
- Verified
-
-
-
-
-
+ No customers found.
+ Loading customers data. Please wait.
+
+
+ {{ data.name }}
+
+
+
+
+
+
+
+
+
+
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+ Customized Buttons
+
+
+
+
+
+
+
{{ data.representative.name }}
+
+
+
+
+
+
+
+
{{ slotProps.option.name }}
+
+
+
+
+
+
+
+ {{ formatDate(data.date) }}
+
+
+
+
+
+
+
+ {{ formatCurrency(data.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ filterModel.value ? filterModel.value[0] : 0 }}
+ {{ filterModel.value ? filterModel.value[1] : 100 }}
+
+
+
+
+
+
+
+
+ Verified
+
+
+
+
+
+
@@ -682,13 +684,13 @@ const getSeverity = (status) => {
created() {
this.initFilters();
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = this.getCustomers(data);
- this.loading = false;
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = this.getCustomers(data);
+ this.loading = false;
+ });
+ },
formatDate(value) {
return value.toLocaleDateString('en-US', {
day: '2-digit',
diff --git a/doc/datatable/filter/BasicFilterDoc.vue b/doc/datatable/filter/BasicFilterDoc.vue
index f352b7fdb..11669fd62 100644
--- a/doc/datatable/filter/BasicFilterDoc.vue
+++ b/doc/datatable/filter/BasicFilterDoc.vue
@@ -6,77 +6,79 @@
The optional global filtering searches the data against a single value that is bound to the global key of the filters object. The fields to search against is defined with the globalFilterFields .
-
-
-
-
-
-
-
-
-
-
- No customers found.
- Loading customers data. Please wait.
-
-
- {{ data.name }}
-
-
-
-
-
-
-
-
-
-
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
{{ data.representative.name }}
-
-
-
-
-
-
-
-
{{ slotProps.option.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ No customers found.
+ Loading customers data. Please wait.
+
+
+ {{ data.name }}
+
+
+
+
+
+
+
+
+
+
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
{{ data.representative.name }}
+
+
+
+
+
+
+
+
{{ slotProps.option.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -510,13 +512,13 @@ const getSeverity = (status) => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = this.getCustomers(data);
- this.loading = false;
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = this.getCustomers(data);
+ this.loading = false;
+ });
+ },
getCustomers(data) {
return [...(data || [])].map((d) => {
d.date = new Date(d.date);
diff --git a/doc/datatable/paginator/PaginatorBasicDoc.vue b/doc/datatable/paginator/PaginatorBasicDoc.vue
index 8dcf2221d..ac3ca5fa2 100644
--- a/doc/datatable/paginator/PaginatorBasicDoc.vue
+++ b/doc/datatable/paginator/PaginatorBasicDoc.vue
@@ -2,14 +2,16 @@
Pagination is enabled by adding paginator property and defining rows per page.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -104,8 +106,10 @@ const customers = ref();
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ }
}
};
diff --git a/doc/datatable/paginator/PaginatorTemplateDoc.vue b/doc/datatable/paginator/PaginatorTemplateDoc.vue
index d51c38d11..7f844bdde 100644
--- a/doc/datatable/paginator/PaginatorTemplateDoc.vue
+++ b/doc/datatable/paginator/PaginatorTemplateDoc.vue
@@ -5,28 +5,30 @@
Paginator component for more information about the advanced customization options.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -145,8 +147,10 @@ const customers = ref();
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ }
}
};
diff --git a/doc/datatable/pt/PTDoc.vue b/doc/datatable/pt/PTDoc.vue
index a08b514c6..0b65c687c 100644
--- a/doc/datatable/pt/PTDoc.vue
+++ b/doc/datatable/pt/PTDoc.vue
@@ -1,51 +1,53 @@
-
-
-
+
+
-
-
-
-
-
+ >
+
+
+
+
+
+
+
@@ -248,8 +250,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/rowgroup/ExpandableRowGroupDoc.vue b/doc/datatable/rowgroup/ExpandableRowGroupDoc.vue
index 96e19d6ce..5647d9cff 100644
--- a/doc/datatable/rowgroup/ExpandableRowGroupDoc.vue
+++ b/doc/datatable/rowgroup/ExpandableRowGroupDoc.vue
@@ -5,46 +5,48 @@
rowgroup-collapse events.
-
-
-
-
- {{ slotProps.data.representative.name }}
-
-
-
-
-
-
-
-
{{ slotProps.data.country.name }}
-
+
+
+
+
+
+ {{ slotProps.data.representative.name }}
-
-
-
-
-
+
+
+
+
+
+
+
{{ slotProps.data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
+ Total Customers: {{ calculateCustomerTotal(slotProps.data.representative.name) }}
-
-
-
- Total Customers: {{ calculateCustomerTotal(slotProps.data.representative.name) }}
-
-
-
+
+
+
@@ -240,7 +242,7 @@ const calculateCustomerTotal = (name) => {
}
}
}
-
+
return total;
};
const getSeverity = (status) => {
@@ -286,10 +288,10 @@ const getSeverity = (status) => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => (this.customers = data));
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ },
onRowGroupExpand(event) {
this.$toast.add({ severity: 'info', summary: 'Row Group Expanded', detail: 'Value: ' + event.data, life: 3000 });
},
diff --git a/doc/datatable/rowgroup/RowSpanRowGroupDoc.vue b/doc/datatable/rowgroup/RowSpanRowGroupDoc.vue
index 8ce657b1a..8da8af521 100644
--- a/doc/datatable/rowgroup/RowSpanRowGroupDoc.vue
+++ b/doc/datatable/rowgroup/RowSpanRowGroupDoc.vue
@@ -2,39 +2,41 @@
When rowGroupMode is configured to be rowspan , the grouping column spans multiple rows.
-
-
-
-
- {{ slotProps.index + 1 }}
-
-
-
-
-
-
-
{{ slotProps.data.representative.name }}
-
-
-
-
-
-
-
-
-
{{ slotProps.data.country.name }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ slotProps.index + 1 }}
+
+
+
+
+
+
+
{{ slotProps.data.representative.name }}
+
+
+
+
+
+
+
+
+
{{ slotProps.data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -242,10 +244,10 @@ const getSeverity = (status) => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => (this.customers = data));
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ },
onRowGroupExpand(event) {
this.$toast.add({ severity: 'info', summary: 'Row Group Expanded', detail: 'Value: ' + event.data, life: 3000 });
},
diff --git a/doc/datatable/rowgroup/SubHeaderRowGroupDoc.vue b/doc/datatable/rowgroup/SubHeaderRowGroupDoc.vue
index 2b40f03f4..3fb99517a 100644
--- a/doc/datatable/rowgroup/SubHeaderRowGroupDoc.vue
+++ b/doc/datatable/rowgroup/SubHeaderRowGroupDoc.vue
@@ -5,36 +5,38 @@
with groupfooter slots.
-
-
-
-
-
-
{{ slotProps.data.representative.name }}
-
-
-
-
-
-
+
+
+
+
-
-
{{ slotProps.data.country.name }}
+
+
{{ slotProps.data.representative.name }}
-
-
-
-
-
+
+
+
+
+
+
+
{{ slotProps.data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
+ Total Customers: {{ calculateCustomerTotal(slotProps.data.representative.name) }}
-
-
-
- Total Customers: {{ calculateCustomerTotal(slotProps.data.representative.name) }}
-
-
-
+
+
+
@@ -214,7 +216,7 @@ const calculateCustomerTotal = (name) => {
}
}
}
-
+
return total;
};
const getSeverity = (status) => {
@@ -260,10 +262,10 @@ const getSeverity = (status) => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => (this.customers = data));
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => (this.customers = data));
+ },
calculateCustomerTotal(name) {
let total = 0;
diff --git a/doc/datatable/rowselection/CheckboxRowSelectionDoc.vue b/doc/datatable/rowselection/CheckboxRowSelectionDoc.vue
index 7d8080917..239d55b46 100644
--- a/doc/datatable/rowselection/CheckboxRowSelectionDoc.vue
+++ b/doc/datatable/rowselection/CheckboxRowSelectionDoc.vue
@@ -3,15 +3,17 @@
Specifying selectionMode as multiple on a Column, displays a checkbox inside that column for selection.
The header checkbox toggles the selection state of the whole dataset by default, when paginator is enabled you may add selectAll property and select-all-change event to only control the selection of visible rows.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -109,8 +111,10 @@ const metaKey = ref(true);
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/rowselection/MultipleRowsSelectionDoc.vue b/doc/datatable/rowselection/MultipleRowsSelectionDoc.vue
index 84d141e44..f67099ef2 100644
--- a/doc/datatable/rowselection/MultipleRowsSelectionDoc.vue
+++ b/doc/datatable/rowselection/MultipleRowsSelectionDoc.vue
@@ -5,18 +5,20 @@
metaKeySelection is present, behavior is changed in a way that selecting a new row requires meta key to be present. Note that in touch enabled devices, DataTable always ignores metaKey.
-
-
-
-
MetaKey
+
+
+
+
+ MetaKey
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
@@ -121,8 +123,10 @@ const metaKey = ref(true);
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/rowselection/RadioButtonRowSelectionDoc.vue b/doc/datatable/rowselection/RadioButtonRowSelectionDoc.vue
index cbd923201..6acd27001 100644
--- a/doc/datatable/rowselection/RadioButtonRowSelectionDoc.vue
+++ b/doc/datatable/rowselection/RadioButtonRowSelectionDoc.vue
@@ -5,15 +5,17 @@
trigger selection using the radio buttons.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -111,8 +113,10 @@ const metaKey = ref(true);
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/rowselection/RowSelectEventsDoc.vue b/doc/datatable/rowselection/RowSelectEventsDoc.vue
index c5379b249..299a946bf 100644
--- a/doc/datatable/rowselection/RowSelectEventsDoc.vue
+++ b/doc/datatable/rowselection/RowSelectEventsDoc.vue
@@ -2,14 +2,16 @@
DataTable provides row-select and row-unselect events to listen selection events.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -124,10 +126,10 @@ const onRowUnselect = (event) => {
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
onRowSelect(event) {
this.$toast.add({ severity: 'info', summary: 'Product Selected', detail: 'Name: ' + event.data.name, life: 3000 });
},
diff --git a/doc/datatable/rowselection/SingleRowSelectionDoc.vue b/doc/datatable/rowselection/SingleRowSelectionDoc.vue
index 4d78cee40..88daa3068 100644
--- a/doc/datatable/rowselection/SingleRowSelectionDoc.vue
+++ b/doc/datatable/rowselection/SingleRowSelectionDoc.vue
@@ -9,18 +9,20 @@
setting it to false.
-
-
-
-
MetaKey
+
+
+
+
+ MetaKey
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
@@ -125,8 +127,10 @@ const metaKey = ref(true);
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/samples/CustomersDoc.vue b/doc/datatable/samples/CustomersDoc.vue
index b713f4592..1c8befc05 100644
--- a/doc/datatable/samples/CustomersDoc.vue
+++ b/doc/datatable/samples/CustomersDoc.vue
@@ -2,103 +2,114 @@
DataTable with selection, pagination, filtering, sorting and templating.
-
-
-
-
-
-
-
-
-
-
-
- No customers found.
-
-
-
- {{ data.name }}
-
-
-
-
-
-
-
-
-
-
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
{{ data.representative.name }}
-
-
-
-
-
-
-
-
{{ slotProps.option.name }}
-
-
-
-
-
-
-
- {{ formatDate(data.date) }}
-
-
-
-
-
-
-
- {{ formatCurrency(data.balance) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ filterModel.value ? filterModel.value[0] : 0 }}
- {{ filterModel.value ? filterModel.value[1] : 100 }}
-
-
-
-
-
-
-
-
-
-
+ No customers found.
+
+
+
+ {{ data.name }}
+
+
+
+
+
+
+
+
+
+
{{ data.country.name }}
+
+
+
+
+
+
+
+
+
+
+
{{ data.representative.name }}
+
+
+
+
+
+
+
+
{{ slotProps.option.name }}
+
+
+
+
+
+
+
+ {{ formatDate(data.date) }}
+
+
+
+
+
+
+
+ {{ formatCurrency(data.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ filterModel.value ? filterModel.value[0] : 0 }}
+ {{ filterModel.value ? filterModel.value[1] : 100 }}
+
+
+
+
+
+
+
+
+
+
+
@@ -628,12 +639,12 @@ const getSeverity = (status) => {
created() {
this.initFilters();
},
- mounted() {
- CustomerService.getCustomersLarge().then((data) => {
- this.customers = this.getCustomers(data);
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersLarge().then((data) => {
+ this.customers = this.getCustomers(data);
+ });
+ },
formatDate(value) {
return value.toLocaleDateString('en-US', {
day: '2-digit',
diff --git a/doc/datatable/samples/ProductsDoc.vue b/doc/datatable/samples/ProductsDoc.vue
index 1346b2d31..549e496cc 100644
--- a/doc/datatable/samples/ProductsDoc.vue
+++ b/doc/datatable/samples/ProductsDoc.vue
@@ -2,73 +2,75 @@
CRUD implementation example with a Dialog.
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
Manage Products
-
-
-
-
-
-
+
+
+
+
Manage Products
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- {{ formatCurrency(slotProps.data.price) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ formatCurrency(slotProps.data.price) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -197,7 +199,7 @@ export default {
-
@@ -258,7 +260,7 @@ export default {
-
@@ -547,7 +549,7 @@ export default {
-
@@ -830,14 +832,13 @@ const getStatusLabel = (status) => {
}
};
},
-
created() {
this.initFilters();
},
- mounted() {
- ProductService.getProducts().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProducts().then((data) => (this.products = data));
+ },
formatCurrency(value) {
if (value) return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
diff --git a/doc/datatable/scroll/FlexibleScrollDoc.vue b/doc/datatable/scroll/FlexibleScrollDoc.vue
index 46a7df2c8..0e05141cf 100644
--- a/doc/datatable/scroll/FlexibleScrollDoc.vue
+++ b/doc/datatable/scroll/FlexibleScrollDoc.vue
@@ -8,7 +8,7 @@
-
+
@@ -140,10 +140,12 @@ onMounted(() => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = data;
- });
+ methods: {
+ onShow() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = data;
+ });
+ }
}
};
diff --git a/doc/datatable/scroll/FrozenColumnsDoc.vue b/doc/datatable/scroll/FrozenColumnsDoc.vue
index 34436cf03..35eefca94 100644
--- a/doc/datatable/scroll/FrozenColumnsDoc.vue
+++ b/doc/datatable/scroll/FrozenColumnsDoc.vue
@@ -2,26 +2,28 @@
A column can be fixed during horizontal scrolling by enabling the frozen property. The location is defined with the alignFrozen that can be left or right .
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- {{ formatCurrency(data.balance) }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatCurrency(data.balance) }}
+
+
+
+
+
@@ -165,12 +167,12 @@ const formatCurrency = (value) => {
}
};
},
- mounted() {
- CustomerService.getCustomersLarge().then((data) => {
- this.customers = data;
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersLarge().then((data) => {
+ this.customers = data;
+ });
+ },
formatCurrency(value) {
return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
}
diff --git a/doc/datatable/scroll/FrozenRowsDoc.vue b/doc/datatable/scroll/FrozenRowsDoc.vue
index a20314399..162440dff 100644
--- a/doc/datatable/scroll/FrozenRowsDoc.vue
+++ b/doc/datatable/scroll/FrozenRowsDoc.vue
@@ -2,30 +2,32 @@
Rows can be fixed during scrolling by enabling the frozenValue property.
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -255,12 +257,12 @@ onMounted(() => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = data;
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = data;
+ });
+ },
toggleLock(data, frozen, index) {
if (frozen) {
this.lockedCustomers = this.lockedCustomers.filter((c, i) => i !== index);
diff --git a/doc/datatable/scroll/HorizontalScrollDoc.vue b/doc/datatable/scroll/HorizontalScrollDoc.vue
index 28b8771cf..4ed8989d2 100644
--- a/doc/datatable/scroll/HorizontalScrollDoc.vue
+++ b/doc/datatable/scroll/HorizontalScrollDoc.vue
@@ -2,23 +2,25 @@
Horizontal scrollbar is displayed when table width exceeds the parent width.
-
-
-
-
-
-
-
-
- {{ formatCurrency(data.balance) }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ formatCurrency(data.balance) }}
+
+
+
+
+
+
+
+
+
@@ -152,12 +154,12 @@ const formatCurrency = (value) => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = data;
- });
- },
methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = data;
+ });
+ },
formatCurrency(value) {
return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
}
diff --git a/doc/datatable/scroll/VerticalScrollDoc.vue b/doc/datatable/scroll/VerticalScrollDoc.vue
index facbc8721..d24973c8b 100644
--- a/doc/datatable/scroll/VerticalScrollDoc.vue
+++ b/doc/datatable/scroll/VerticalScrollDoc.vue
@@ -2,14 +2,16 @@
Adding scrollable property along with a scrollHeight for the data viewport enables vertical scrolling with fixed headers.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -107,10 +109,12 @@ onMounted(() => {
}
};
},
- mounted() {
- CustomerService.getCustomersMedium().then((data) => {
- this.customers = data;
- });
+ methods: {
+ loadDemoData() {
+ CustomerService.getCustomersMedium().then((data) => {
+ this.customers = data;
+ });
+ }
}
};
diff --git a/doc/datatable/sort/MultipleColumnsDoc.vue b/doc/datatable/sort/MultipleColumnsDoc.vue
index 7c52ea393..c421b1823 100644
--- a/doc/datatable/sort/MultipleColumnsDoc.vue
+++ b/doc/datatable/sort/MultipleColumnsDoc.vue
@@ -2,14 +2,16 @@
Multiple columns can be sorted by defining sortMode as multiple . This mode requires metaKey (e.g. ⌘ ) to be pressed when clicking a header.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -98,8 +100,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/sort/PresortDoc.vue b/doc/datatable/sort/PresortDoc.vue
index 9cd7190c8..a4b6fc469 100644
--- a/doc/datatable/sort/PresortDoc.vue
+++ b/doc/datatable/sort/PresortDoc.vue
@@ -5,19 +5,21 @@
DataTableSortMeta objects.
-
-
-
-
-
-
- {{ formatCurrency(slotProps.data.price) }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ formatCurrency(slotProps.data.price) }}
+
+
+
+
+
+
+
@@ -129,10 +131,10 @@ const formatCurrency = (value) => {
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
- },
methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ },
formatCurrency(value) {
return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
}
diff --git a/doc/datatable/sort/RemovableSortDoc.vue b/doc/datatable/sort/RemovableSortDoc.vue
index 4b52bb00e..c4d3309d2 100644
--- a/doc/datatable/sort/RemovableSortDoc.vue
+++ b/doc/datatable/sort/RemovableSortDoc.vue
@@ -2,14 +2,16 @@
When removableSort is present, the third click removes the sorting from the column.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -98,8 +100,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/sort/SingleColumnDoc.vue b/doc/datatable/sort/SingleColumnDoc.vue
index 882f4a9da..5448f7e2f 100644
--- a/doc/datatable/sort/SingleColumnDoc.vue
+++ b/doc/datatable/sort/SingleColumnDoc.vue
@@ -2,14 +2,16 @@
Sorting on a column is enabled by adding the sortable property.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -98,8 +100,10 @@ const products = ref();
}
};
},
- mounted() {
- ProductService.getProductsMini().then((data) => (this.products = data));
+ methods: {
+ loadDemoData() {
+ ProductService.getProductsMini().then((data) => (this.products = data));
+ }
}
};
diff --git a/doc/datatable/virtualscroll/LazyVirtualScrollDoc.vue b/doc/datatable/virtualscroll/LazyVirtualScrollDoc.vue
index e5b68df22..b8262d897 100644
--- a/doc/datatable/virtualscroll/LazyVirtualScrollDoc.vue
+++ b/doc/datatable/virtualscroll/LazyVirtualScrollDoc.vue
@@ -3,51 +3,53 @@
When lazy loading is enabled via the virtualScrollerOptions , data is fetched on demand during scrolling instead of preload.
In sample below, an in-memory list and timeout is used to mimic fetching from a remote datasource. The virtualCars is an empty array that is populated on scroll.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -280,10 +282,10 @@ const loadCarsLazy = (event) => {
}
};
},
- mounted() {
- this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
- },
methods: {
+ loadDemoData() {
+ this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
+ },
loadCarsLazy(event) {
!this.lazyLoading && (this.lazyLoading = true);
diff --git a/doc/datatable/virtualscroll/PreloadVirtualScrollDoc.vue b/doc/datatable/virtualscroll/PreloadVirtualScrollDoc.vue
index 013164339..69772898e 100644
--- a/doc/datatable/virtualscroll/PreloadVirtualScrollDoc.vue
+++ b/doc/datatable/virtualscroll/PreloadVirtualScrollDoc.vue
@@ -6,15 +6,17 @@
In this example, 100000 preloaded records are rendered by the Table.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -98,8 +100,10 @@ onMounted(() => {
}
};
},
- mounted() {
- this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
+ methods: {
+ loadDemoData() {
+ this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
+ }
}
};
diff --git a/plugins/app.js b/plugins/app.js
index 11cf8d2ca..b7bf41450 100644
--- a/plugins/app.js
+++ b/plugins/app.js
@@ -1,5 +1,7 @@
+import DeferredDemo from '@/components/demo/DeferredDemo.vue';
import CodeHighlight from '@/directives/CodeHighlight';
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.directive('code', CodeHighlight);
+ nuxtApp.vueApp.component('DeferredDemo', DeferredDemo); // @todo
});