Collapse columns by default and updateSettings

Tags: #<Tag:0x00007efc651ada70>

I used to collapse the columns by default using this approach: collapseSection

But… If you call updateSettings then you need to call collapseSection again.
If you have to change several times the settings, the performance become very bad.

` afterSelection: function(row1,col1,row2,col2) {
console.log(row1,col1,row2,col2);
var cellMeta = hotRegisterer.getInstance(‘hotAnalysis’).getCellMeta(row2,col2);
if(cellMeta.prop == ‘machineProposal’) {
hotRegisterer.getInstance(‘hotAnalysis’).updateSettings({fillHandle: false});
hotRegisterer.getInstance(‘hotAnalysis’).getPlugin(‘collapsibleColumns’).collapseSection({row: -(vm.tableHeaders.length - 1), col: 1 + fixedColumns.length});
} else {
hotRegisterer.getInstance(‘hotAnalysis’).updateSettings({fillHandle: ‘vertical’});
hotRegisterer.getInstance(‘hotAnalysis’).getPlugin(‘collapsibleColumns’).collapseSection({row: -(vm.tableHeaders.length - 1), col: 1 + fixedColumns.length});
}

    }`

Hi @jromero
Can you create a JSFiddle/JSBin demo where we’ll be able to reproduce the behavior?

How can I do it? collapsibleColumns its a PRO feature

You can fork @budnix example: http://jsfiddle.net/budnix/rcj9s04t/1/

Sorry but I think that it is not necessary to build another example.

The problem here is every time you call updateSettings method, then you have to collapse the column sections again.
Is there any option to make the collapsibleColumns to be collapsed on init?

I have done the example:

http://jsfiddle.net/ez1pgh99/1/

If you ask me I would mark this issue as a bug cause the width setting should not clear the collapsing.

Yes please I think it is a bug. Please if you get the patch for it notify me

Of course @jromero
As soon as this issue gets fixed we will notify about it in this post

@jromero
I’ve made an example that hides colums after calling updateSettings, maybe you’ll find is useful: http://jsfiddle.net/gznkhttc/

1 Like