From db0a5d958d765cd6de2a19babf717fe9a2356dd0 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Mon, 18 Nov 2019 11:00:39 +0300 Subject: [PATCH] Refactored Table Header into a separate component --- src/components/datatable/DataTable.vue | 42 ++--------------- src/components/datatable/TableFooter.vue | 59 ++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 src/components/datatable/TableFooter.vue diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 7d25d2302..66375e3f8 100644 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -69,24 +69,7 @@ - - > - - - {{col.footer}} - - - - + 0); }, - hasFooter() { - let hasFooter = false; - - if (this.footerColumnGroup) { - hasFooter = true; - } - else { - for (let col of this.columns) { - if (col.footer || col.$scopedSlots.footer) { - hasFooter = true; - break; - } - } - } - - return hasFooter; - }, hasFilters() { return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; }, @@ -1719,11 +1685,11 @@ export default { } }, components: { - 'ColumnSlot': ColumnSlot, 'DTPaginator': Paginator, 'DTBodyCell': BodyCell, //'DTScrollableView': ScrollableView, - 'DTTableHeader': TableHeader + 'DTTableHeader': TableHeader, + 'DTTableFooter': TableFooter } } diff --git a/src/components/datatable/TableFooter.vue b/src/components/datatable/TableFooter.vue new file mode 100644 index 000000000..3cdd878d0 --- /dev/null +++ b/src/components/datatable/TableFooter.vue @@ -0,0 +1,59 @@ + + + \ No newline at end of file