-
16 May 2008 10:57 AM #1
cm has no properties in Ext 2.0
cm has no properties in Ext 2.0
Hi,
I'm trying to use a grid. I have everything working when I use this construct:
var grid = new Ext.grid.GridPanel({
title: 'Customers',
colModel : cm
blah blah
...
grid.render('mygrid');
but I get a 'cm has no properties' runtime error when I code it like this:
var grid = new Ext.grid.GridPanel('mygrid', {
title: 'Customers',
colModel : cm
blah blah
grid.render();
My ColumnModel object looks like this:
var cm = new Ext.grid.ColumnModel([
{ id: 'id',
header: "id",
dataIndex: 'id',
width: 50
},
{
header: "First Name",
dataIndex: 'first_name',
width: 120
},
{
header: "Last Name",
dataIndex: 'last_name',
width: 150
},
{
header: "Client",
dataIndex: 'client_name',
width : 200,
sortable: true
},
{
header: "Email Address",
dataIndex: 'email_addr',
width: 200
}
]);
This is all Ext 2.0 code. Anyone have any brilliant ideas what I'm doing wrong?
Thanks.
-
16 May 2008 12:45 PM #2
Are you extending a class or what are you trying to do that you want the different constructor?
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
16 May 2008 1:10 PM #3
Migrating from 1.1?
Migrating from 1.1?
Not valid for 2.0+ :
Code:var grid = new Ext.grid.GridPanel('mygrid', { renderTo : 'mygrid', //instead ......"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
16 May 2008 2:40 PM #4
I'm trying to do this so that I can add the resizable feature to my grid. The only example I could find uses the syntax I quoted. So, really, the question I have is how to add the resizable functionality to a grid, all coded in Ext 2.0
-
17 May 2008 7:19 AM #5
Sorry don't know what you mean by resizable. There are several tutorials with respect to extending in the Learn section.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
21 May 2008 9:34 AM #6
Regarding resizable, I got this code from somewhere
Regarding resizable, I got this code from somewhere
// make the grid resizable, do before render for better performance
/* var rz = new Ext.Resizable('mygrid', {
wrap:true,
minHeight:100,
pinned:true,
handles: 's'
});
rz.on('resize', grid.autoSize, grid); */
I forget where I got it from, but it looks like it is supposed to give me a handle on my grid so I can resize it.


Reply With Quote

