PDA

View Full Version : move columns in a lock enabled grid



vick_44
25 May 2018, 3:32 AM
I have a grid which needs to have few locked columns on a toggle button press and get them unlocked when I press the button again. Right now I have this functionality working but the problem is when I press the button the second time, the unlocked columns stays at the new position , that is on the left side of the grid. I need to move them back to their original index. Is it possible to move the columns in a grid once i unlock all columns?

The problem I am facing is once i unlock all the grid columns, when I try to move the column nothing happens. I figure its due to the property 'enableLocking: true' in the grid. Below is a simple fiddle which shows moving columns, right now I have commented enableLocking: true at line 39. As soon as you uncomment (#39) it, the move column stops working.

https://fiddle.sencha.com/#fiddle/2h93&view/editor

Is there any way to achieve this functionality, to move columns by their index in a grid where enableLocking is true?.
Any help or pointers is deeply appreciated!!!.

twaindev
30 May 2018, 2:39 AM
Maybe this helps:


handler: function (btn) {
var grid = btn.up('gridpanel'),
headerCt = grid.normalGrid.headerCt;

headerCt.move(0,1);

grid.getView().refresh();
}

vick_44
4 Jun 2018, 5:08 AM
Thanks : ). This works like a charm!!!