From d4f1d1bfdb6ea07f02f4572f890bc49605706dce Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Tue, 19 Nov 2019 17:05:22 +0300 Subject: [PATCH] lint fixes --- src/components/datatable/DataTable.vue | 12 ++++++------ src/views/datatable/DataTableDoc.vue | 4 ++-- src/views/datatable/DataTableScrollDemo.vue | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 43163da22..a819aba61 100644 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -1031,7 +1031,7 @@ export default { this.resizeColumnElement.style.width = newColumnWidth + 'px'; if(nextColumn) { nextColumn.style.width = nextColumnWidth + 'px'; - } + } } } } @@ -1069,7 +1069,7 @@ export default { let col = colGroup.children[resizeColumnIndex]; let nextCol = col.nextElementSibling; col.style.width = newColumnWidth + 'px'; - + if (nextCol && nextColumnWidth) { nextCol.style.width = nextColumnWidth + 'px'; } @@ -1246,7 +1246,7 @@ export default { const scrollableBodyTableWidth = column ? scrollableBodyTable.offsetWidth + delta : newColumnWidth; const scrollableHeaderTableWidth = column ? scrollableHeaderTable.offsetWidth + delta : newColumnWidth; const isContainerInViewport = this.$el.offsetWidth >= parseFloat(scrollableBodyTableWidth); - + let setWidth = (container, table, width, isContainerInViewport) => { if (container && table) { container.style.width = isContainerInViewport ? width + DomHandler.calculateScrollbarWidth(scrollableBody) + 'px' : 'auto' @@ -1257,7 +1257,7 @@ export default { setWidth(scrollableBody, scrollableBodyTable, scrollableBodyTableWidth, isContainerInViewport); setWidth(scrollableHeader, scrollableHeaderTable, scrollableHeaderTableWidth, isContainerInViewport); setWidth(scrollableFooter, scrollableFooterTable, scrollableHeaderTableWidth, isContainerInViewport); - + if (column) { let resizeColumnIndex = DomHandler.index(column); @@ -1535,7 +1535,7 @@ export default { this.$el.style.width = this.tableWidthState; } } - + if (this.scrollable) { let headerCols = DomHandler.find(this.$el, '.p-datatable-scrollable-header-table > colgroup > col'); let bodyCols = DomHandler.find(this.$el, '.p-datatable-scrollable-body-table > colgroup > col'); @@ -1548,7 +1548,7 @@ export default { headers.forEach((header, index) => header.style.width = widths[index] + 'px'); } - + } }, onCellEditInit(event) { diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index 9bf055c1b..819a9be53 100644 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -645,8 +645,8 @@ data() {

When using frozen columns with column grouping, use frozenheadergroup and frozenfootergroup types to define grouping for the frozen section.

-

Virtual scrolling is enabled using virtualScroll and onVirtualScroll properties combined with lazy loading so that data is loaded on the fly during scrolling. - For smooth scrolling twice the amount of rows property is loaded on a lazy load event. In addition, to avoid performance problems row height is not calculated automatically and +

Virtual scrolling is enabled using virtualScroll and onVirtualScroll properties combined with lazy loading so that data is loaded on the fly during scrolling. + For smooth scrolling twice the amount of rows property is loaded on a lazy load event. In addition, to avoid performance problems row height is not calculated automatically and should be provided using virtualRowHeight property which defaults to 28px. View the scrolling demo for a sample in-memory implementation.

diff --git a/src/views/datatable/DataTableScrollDemo.vue b/src/views/datatable/DataTableScrollDemo.vue index 5038acd34..97193dc26 100644 --- a/src/views/datatable/DataTableScrollDemo.vue +++ b/src/views/datatable/DataTableScrollDemo.vue @@ -230,7 +230,7 @@ export default { this.loading = false; }); }, 150); - + this.frozenCars = [ {brand: "BMW", year: 2013, color: "Grey", vin: "fh2uf23"}, {brand: "Chevrolet", year: 2011, color: "Black", vin: "4525g23"} @@ -244,7 +244,7 @@ export default { methods: { loadChunk(index, length) { let chunk = []; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; i++) { chunk[i] = {...this.inmemoryData[i], ...{vin: (index + i)}}; } @@ -354,7 +354,7 @@ export default { this.loading = false; }); }, 150); - + this.frozenCars = [ {brand: "BMW", year: 2013, color: "Grey", vin: "fh2uf23"}, {brand: "Chevrolet", year: 2011, color: "Black", vin: "4525g23"}