PDA

View Full Version : Config option to set on Ext.grid.Column, so that the column is not Draggable?



kugaprakash
24 Aug 2010, 5:57 PM
Hi,
Can anyone let me know if there is a config option to set on the Ext.grid.Column so that the column is not draggable? Essentially I would like to have a few column set at its position, however, other columns could be draggable.

Thanks
Kuga

Animal
24 Aug 2010, 9:17 PM
But of course if you drag a column, the others move, so even if a column is not draggable, it's still not fixed.

kugaprakash
24 Aug 2010, 10:00 PM
Ok, Not sure if it is clear, here is a detailed example:
For instance I have 10 columns:
Columns 1,2,3 are fixed, meaning these 3 columns cannot be dragged or change the position.
if the user tries to drag column 4 or 5 to position 1,2 or 3, the drop should not accept this, rather consume the drop event and not move it.

Typically in Java Swing The way they achieve this is by creating 2 tables, the first one does not have the ability to move columns, and the second one has ability to move columns.

Thanks
Kuga

Animal
24 Aug 2010, 11:30 PM
What if just 2 and 3 are fixed?

Then someone drops column 10 at column 1?

2 and 3 have just become 3 and 4

joeri
25 Aug 2010, 6:44 AM
I assume what you're really asking for is to be able to lock the first X columns in the grid?

http://dev.sencha.com/deploy/dev/examples/grid/locking-grid.html

kugaprakash
25 Aug 2010, 8:26 AM
In this case, I believe it should be SWAP, meaning 10 to 1 & 1 to 10...
I dont have these requirements as yet, but I would suspect this would be the expected behavior
Thanks
Kuga

kugaprakash
25 Aug 2010, 12:38 PM
Hi,
Yes, you are almost correct, with only one exception: I am able to move Company column, but for my example, it should not move.
From the first look, it looked exactly what I wanted, the scrollbars start from "Price" column and vertical scrolling also moves the "company" as well. However, If the user moves the Company column to a different position, the entire grid is now different.

Please let me know if there is some way to "Lock" the column?
Thanks
Kuga



I assume what you're really asking for is to be able to lock the first X columns in the grid?

http://dev.sencha.com/deploy/dev/examples/grid/locking-grid.html