PDA

View Full Version : Configuration of the grid



olimpia
29 May 2007, 8:19 AM
As I should do to recover the configurations of the columns of the grid.
After the user to do resize, drag and drop, or to hide some field has to recover this configuration ?

Some exists method that comes back me the culunas of the grid, with its properties dataIndex and height ?

olimpia
30 May 2007, 3:46 AM
I used the code below

for(var colcnt=0;colcnt<cm.getColumnCount();colcnt++) {
if (!cm.isHidden(colcnt)){
alert(cm.getDataIndex(colcnt) + ' ' + cm.getColumnWidth(colcnt));
}
}

Do I have to execute this code above when to happen the event mouseDown in the header of the grid
I made the test below, but didn't give right.

grid.on('mousedown',onMouseDown);

How should I do

tryanDLS
30 May 2007, 6:56 AM
Please post your code in 'code' tags rather than bold and italic.

What is 'onMouseDown' is that a function your wrote?

Look at the grid code which builds the context menu when you right click - you can follow the same process to get the column info.