Compare commits
1 Commits
master
...
handle-0-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3967139b22 |
@ -16,6 +16,11 @@ export default class BodyRenderer {
|
|||||||
this.visibleRows = rows;
|
this.visibleRows = rows;
|
||||||
this.visibleRowIndices = rows.map(row => row.meta.rowIndex);
|
this.visibleRowIndices = rows.map(row => row.meta.rowIndex);
|
||||||
|
|
||||||
|
if (rows.length === 0) {
|
||||||
|
this.bodyScrollable.innerHTML = this.getNoDataHTML();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const rowViewOrder = this.datamanager.rowViewOrder.map(index => {
|
const rowViewOrder = this.datamanager.rowViewOrder.map(index => {
|
||||||
if (this.visibleRowIndices.includes(index)) {
|
if (this.visibleRowIndices.includes(index)) {
|
||||||
return index;
|
return index;
|
||||||
|
|||||||
@ -251,7 +251,8 @@ export default class Style {
|
|||||||
if (this.options.layout !== 'fluid') return;
|
if (this.options.layout !== 'fluid') return;
|
||||||
|
|
||||||
const wrapperWidth = $.style(this.instance.datatableWrapper, 'width');
|
const wrapperWidth = $.style(this.instance.datatableWrapper, 'width');
|
||||||
const firstRowWidth = $.style($('.dt-row', this.bodyScrollable), 'width');
|
const firstRow = $('.dt-row', this.bodyScrollable);
|
||||||
|
const firstRowWidth = firstRow ? $.style(firstRow, 'width') : wrapperWidth;
|
||||||
const resizableColumns = this.datamanager.getColumns().filter(col => col.resizable);
|
const resizableColumns = this.datamanager.getColumns().filter(col => col.resizable);
|
||||||
const deltaWidth = (wrapperWidth - firstRowWidth) / resizableColumns.length;
|
const deltaWidth = (wrapperWidth - firstRowWidth) / resizableColumns.length;
|
||||||
|
|
||||||
@ -297,7 +298,7 @@ export default class Style {
|
|||||||
setBodyStyle() {
|
setBodyStyle() {
|
||||||
const bodyWidth = $.style(this.datatableWrapper, 'width');
|
const bodyWidth = $.style(this.datatableWrapper, 'width');
|
||||||
const firstRow = $('.dt-row', this.bodyScrollable);
|
const firstRow = $('.dt-row', this.bodyScrollable);
|
||||||
const rowWidth = $.style(firstRow, 'width');
|
const rowWidth = firstRow ? $.style(firstRow, 'width') : bodyWidth;
|
||||||
|
|
||||||
let width = bodyWidth > rowWidth ? rowWidth : bodyWidth;
|
let width = bodyWidth > rowWidth ? rowWidth : bodyWidth;
|
||||||
$.style(this.bodyScrollable, {
|
$.style(this.bodyScrollable, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user