fix: update rowIndex width when row count changes (#138)
* fix: update rowIndex width when row count changes * fix: removed unwanted code * fix: Added Refresh Data button
This commit is contained in:
parent
cb2729424b
commit
8ceadaccba
@ -18,7 +18,8 @@
|
||||
|
||||
<body>
|
||||
<h1>Frappé DataTable</h1>
|
||||
<button onclick="datatable.render()">Refresh</button>
|
||||
<button onclick="datatable.render()">Render Table</button>
|
||||
<button onclick="datatable.refresh()">Refresh Data</button>
|
||||
<button onclick="switchToTreeView()" data-action="treeview">TreeView</button>
|
||||
<label>
|
||||
<input type="checkbox" id="input-large-data" />
|
||||
|
||||
@ -192,11 +192,6 @@ export default class Style {
|
||||
|
||||
let naturalWidth = $.style($('.dt-cell__content', $cell), 'width');
|
||||
|
||||
if (column.id === '_rowIndex') {
|
||||
naturalWidth = this.getRowIndexColumnWidth();
|
||||
column.width = naturalWidth;
|
||||
}
|
||||
|
||||
if (typeof naturalWidth === 'number' && naturalWidth >= column.naturalWidth) {
|
||||
column.naturalWidth = naturalWidth;
|
||||
} else {
|
||||
@ -245,6 +240,9 @@ export default class Style {
|
||||
if (!column.width) {
|
||||
column.width = column.naturalWidth;
|
||||
}
|
||||
if (column.id === '_rowIndex') {
|
||||
column.width = this.getRowIndexColumnWidth();
|
||||
}
|
||||
if (column.width < this.options.minimumColumnWidth) {
|
||||
column.width = this.options.minimumColumnWidth;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user