PDA

View Full Version : EditorGrid config object cm: colModel and getColumnModel



Devany
17 Apr 2007, 8:15 AM
I'm just about there (I think) with the zen of ext, but I have a conceptual issue I need to clear up.

With Ext 1.0

In Ext/examples/grid/edit-grid.js the code presented to 'bind' the column model to the grid appears in the following:



// create the editor grid
var grid = new Ext.grid.EditorGrid('editor-grid', {
ds: ds,
cm: cm,
//selModel: new Ext.grid.RowSelectionModel(),
enableColLock:false
});

The column model is passed in a config object via the property named cm, but reading this in EditorGrid.js, it appears to be commented as colModel.

My questions are:

Where is the config object for the grid documented?

Is there a consistent rationale (that I don't get yet) for calling the column model cm in the config object?

How should I access the column model from the grid? Using Firebug, I appear to have to use grid.grid.getColumnModel. Why is this not grid.getColumnModel?

Thanks & regards

tryanDLS
17 Apr 2007, 8:27 AM
This may partly be a holder-over from .33 compatibility. The config property name is cm - the grid constructor saves this as a property called colModel.

The grid config hasn't been documented yet. Looking at the source, the only config entries are
ds (dataSource), cm (colModel), sm (selModel), width and height.

grid.getColumnModel() is the correct way to get the colModel