PDA

View Full Version : Ext.grid.Grid short call doesn't work



kimu
25 Apr 2007, 3:33 AM
In documentation I've seen that Ext.grid.Grid can be called with this syntax

Ext.grid.Grid('element-id', dataStore, columnModel);

It's not working, I always got this error:

cm has no properties
render()ext-all-debug.js (line 25511)
render()ext-all-debug.js (line 24074)
successValidationsRequest(Object tId=2 status=200 statusText=OK)main.js (line 568)
apply()ext-yui-adapter.j... (line 9)
setProgId(Object conn=XMLHttpRequest tId=2, Object timeout=50000, undefined)yui-utilities.js (line 15)
setProgId()yui-utilities.js (line 15)
[Break on this error] var colCount = cm.getColumnCount();

It seems that the config object is not optional:

Ext.grid.Grid('element-id', {ds: dataStore, cm: columnModel});

You have to use it, but documentation says that also the first method is available.

tryanDLS
25 Apr 2007, 9:56 AM
That's the old .33 syntax - it's not valid in 1.0; you have to pass a config object. The doc has been updated in SVN.