fix: Allow column to be resized below naturalWidth
- Also honor minimumColumnWidth option
This commit is contained in:
parent
ffab69de34
commit
8d96f953cd
@ -179,7 +179,7 @@ export default class ColumnManager {
|
||||
colIndex
|
||||
} = $.data($resizingCell);
|
||||
|
||||
let columnMinWidth = 30;
|
||||
let columnMinWidth = this.options.minimumColumnWidth;
|
||||
if (columnMinWidth > finalWidth) {
|
||||
// don't resize past 30 pixels
|
||||
return;
|
||||
|
||||
@ -56,7 +56,7 @@ export default {
|
||||
layout: 'fixed', // fixed, fluid, ratio
|
||||
noDataMessage: 'No Data',
|
||||
cellHeight: 40,
|
||||
minimumColumnWidth: 70,
|
||||
minimumColumnWidth: 30,
|
||||
inlineFilters: false,
|
||||
treeView: false,
|
||||
checkedRowStatus: true,
|
||||
|
||||
@ -189,10 +189,10 @@ export default class Style {
|
||||
column.width = naturalWidth;
|
||||
}
|
||||
|
||||
if (typeof naturalWidth === 'number' && naturalWidth >= this.options.minimumColumnWidth) {
|
||||
if (typeof naturalWidth === 'number' && naturalWidth >= column.naturalWidth) {
|
||||
column.naturalWidth = naturalWidth;
|
||||
} else {
|
||||
column.naturalWidth = this.options.minimumColumnWidth;
|
||||
column.naturalWidth = column.naturalWidth;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -237,8 +237,8 @@ export default class Style {
|
||||
if (!column.width) {
|
||||
column.width = column.naturalWidth;
|
||||
}
|
||||
if (column.width < column.minWidth) {
|
||||
column.width = column.minWidth;
|
||||
if (column.width < this.options.minimumColumnWidth) {
|
||||
column.width = this.options.minimumColumnWidth;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user