Set minWidth for columns

This commit is contained in:
Faris Ansari 2017-10-27 16:30:50 +05:30
parent 3d43f77514
commit b409b849d4
3 changed files with 826 additions and 818 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -276,10 +276,14 @@ export default class DataTable {
// set initial width as naturally calculated by table's first row
this.bodyScrollable.find('.data-table-row[data-row-index="0"] .data-table-col').each(function () {
const $cell = $(this);
const width = parseInt($cell.find('.content').css('width'), 10);
let width = parseInt($cell.find('.content').css('width'), 10);
const height = parseInt($cell.find('.content').css('height'), 10);
const { colIndex } = self.getCellAttr($cell);
const minWidth = self.getColumnMinWidth(colIndex);
if (width < minWidth) {
width = minWidth;
}
self.setColumnWidth(colIndex, width);
self.setDefaultCellHeight(height);
});