diff --git a/doc/datatable/samples/ProductsDoc.vue b/doc/datatable/samples/ProductsDoc.vue index 982570427..22a585cb5 100644 --- a/doc/datatable/samples/ProductsDoc.vue +++ b/doc/datatable/samples/ProductsDoc.vue @@ -509,6 +509,21 @@ export default { this.filters = { 'global': {value: null, matchMode: FilterMatchMode.CONTAINS}, } + }, + getStatusLabel(status) { + switch (status) { + case 'INSTOCK': + return 'success'; + + case 'LOWSTOCK': + return 'warning'; + + case 'OUTOFSTOCK': + return 'danger'; + + default: + return null; + } } } } @@ -778,6 +793,22 @@ const deleteSelectedProducts = () => { toast.add({severity:'success', summary: 'Successful', detail: 'Products Deleted', life: 3000}); }; +const getStatusLabel = (status) => { + switch (status) { + case 'INSTOCK': + return 'success'; + + case 'LOWSTOCK': + return 'warning'; + + case 'OUTOFSTOCK': + return 'danger'; + + default: + return null; + } +}; + <\/script> ` }