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.