Continuing the discussion from Enabling manualColumnMove and hiddenColumns displays Empty Values in Column (PRO):
I just found the initial issue reported on the ticket was already solved with the version 1.3.2, but now I am facing same issue when I enable ‘manualColumnResize’ plugin.
Again, our main goal is to enable “hide/show”, “manualColumnMove” and “manualColumnSize” for our users and be able to save the state of the table in the browser without any issue, as you are not supporting persistence for “hide/show” we just handle that and then use the plugin to hide/show after creating the table, as described in my examples:
I am trying two different approaches to define column sizes, with similar catastrophic results:
A) Having 6 columns and defining ‘manualColumnResize’ as array with the default sizes for my columns, persistentState as true and colWidths undefined.
hot1 = new Handsontable(table,{
data: Handsontable.helper.createSpreadsheetData(100, 6),
colHeaders: ['A', 'B', 'C', 'D', 'E', 'F'],
manualColumnMove: [0,1,2,4,3],
manualColumnResize: [50, 50],
hiddenColumns: true,
stretchH: 'all',
persistentState: true,
rowHeaders: true,
dropdownMenu: true,
renderAllRows: true
});
And then hiding columns [0,5]:
hot1.getPlugin('hiddenColumns').hideColumns([0,5]);
Result: Column 5 (“F”) was hidden, but since column 0 (“A”) has a size defined in “manualColumnResize”, the column is displayed as empty. Here is the JSFiddle http://jsfiddle.net/gvazq82/s3kdc04c/
B) Having the same 6 columns but instead of define as Array manualColumnResize, I define ‘colWidths’.
hot1 = new Handsontable(table,{
data: Handsontable.helper.createSpreadsheetData(100, 6),
colHeaders: ['A', 'B', 'C', 'D', 'E', 'F'],
manualColumnMove: [0,1,2,4,3],
manualColumnResize: true, //[50, 50, null, 50, null, null],
colWidths: [10, 50, null, 50, null, null],
hiddenColumns: true,
stretchH: 'all',
persistentState: true,
rowHeaders: true,
dropdownMenu: true,
renderAllRows: true
});
And then hiding columns [0,5]:
hot1.getPlugin('hiddenColumns').hideColumns([0,5]);
Result: The initial display seems correct, but now I resize the column ‘C’ and refresh the page, for some reason the column ‘F’ that should be hidden, is displayed with empty content. Here is JSFiddle http://jsfiddle.net/gvazq82/rbrqe8dh/
Please let me know your comments and if there is any solution for this.
I appreciate your prompt response.
Thanks,
Gabriel.