PDA

View Full Version : Disable columns move between groups.



srichakrab
30 Mar 2015, 7:05 AM
Hi

Can some one help me with a code snippet for avoid moving columns between columns groups for below code.

Below columns are pushed in to a tree panel.

columns.push({
text : 'group1',
autoSizeColumn: true,
itemId:'group1Column',
cls : 'x-column-header-text-bold',
enableColumnMove : false,
columns : function(){
child columns code hear
}
});
columns.push({
text : 'group2',
autoSizeColumn: true,
itemId:'group2column',
cls : 'x-column-header-text-bold',
enableColumnMove : false,
columns : function(){
child columns code hear
}
});

Gary Schlosberg
2 Apr 2015, 11:27 AM
According to the docs, the enableColumnMove (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Table-cfg-enableColumnMove) config should be set on the table or grid rather than on each column. Hopefully that gets it working for you.

srichakrab
2 Apr 2015, 12:20 PM
Thanks for the reply.

If we put enableColumnMove to false it dont allow columns to move, but i need columns only not to move between groups.

For example
If
we have subColumn1,subColumn2 and subColumn3 in group1Column and subColumnA,subColumnB and subColumnC in group2Columns.
Then
I should disable moving subColumn1 to group2Columns i.e subColumn1 should not be with subColumnA or subColumnB or subColumnC.

Hope this is clear

evant
2 Apr 2015, 4:13 PM
See: http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.panel.Table-cfg-sealedColumns

srichakrab
6 Apr 2015, 11:22 AM
I tried that its not working.

Ext.define('PositionData', {
extend : 'Ext.grid.Panel',
border : true,
autoScroll : true,
useArrows : true,
columnLines : true,
rowLines: true,
enableColumnMove : true,
sealedColumns : true,
config : {
filterData : {},
columnData : {},
menuData : {}
},

initComponent: function() { ....

Gary Schlosberg
7 Apr 2015, 2:21 PM
Seems to work for me when I set sealed (http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.grid.header.Container-cfg-sealed) to true for the parent columns.

dekel.y
19 Jul 2015, 10:57 AM
sealed per column works fine but per docs, sealedColumns should also work in grid level.
I don't want to seal every grouped column.
Is there a solution for that? is that a bug? I'm working with 4.1.1

Gary Schlosberg
20 Jul 2015, 4:00 PM
Seems (if you don't want to seal all grouped columns) that setting it on the column would be better than setting it on the grid, no?