From 00f0fecb90072bd47504ed69dc953abdf32c800e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 2 Mar 2023 17:17:54 +0300 Subject: [PATCH] DataTable products demo updated --- doc/datatable/samples/ProductsDoc.vue | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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> ` }