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
|
colIndex
|
||||||
} = $.data($resizingCell);
|
} = $.data($resizingCell);
|
||||||
|
|
||||||
let columnMinWidth = 30;
|
let columnMinWidth = this.options.minimumColumnWidth;
|
||||||
if (columnMinWidth > finalWidth) {
|
if (columnMinWidth > finalWidth) {
|
||||||
// don't resize past 30 pixels
|
// don't resize past 30 pixels
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default {
|
|||||||
layout: 'fixed', // fixed, fluid, ratio
|
layout: 'fixed', // fixed, fluid, ratio
|
||||||
noDataMessage: 'No Data',
|
noDataMessage: 'No Data',
|
||||||
cellHeight: 40,
|
cellHeight: 40,
|
||||||
minimumColumnWidth: 70,
|
minimumColumnWidth: 30,
|
||||||
inlineFilters: false,
|
inlineFilters: false,
|
||||||
treeView: false,
|
treeView: false,
|
||||||
checkedRowStatus: true,
|
checkedRowStatus: true,
|
||||||
|
|||||||
@ -189,10 +189,10 @@ export default class Style {
|
|||||||
column.width = naturalWidth;
|
column.width = naturalWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof naturalWidth === 'number' && naturalWidth >= this.options.minimumColumnWidth) {
|
if (typeof naturalWidth === 'number' && naturalWidth >= column.naturalWidth) {
|
||||||
column.naturalWidth = naturalWidth;
|
column.naturalWidth = naturalWidth;
|
||||||
} else {
|
} else {
|
||||||
column.naturalWidth = this.options.minimumColumnWidth;
|
column.naturalWidth = column.naturalWidth;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -237,8 +237,8 @@ export default class Style {
|
|||||||
if (!column.width) {
|
if (!column.width) {
|
||||||
column.width = column.naturalWidth;
|
column.width = column.naturalWidth;
|
||||||
}
|
}
|
||||||
if (column.width < column.minWidth) {
|
if (column.width < this.options.minimumColumnWidth) {
|
||||||
column.width = column.minWidth;
|
column.width = this.options.minimumColumnWidth;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user