View Full Version : Help with Debugging Grid

26 Apr 2011, 1:19 PM
In working up my own app from examples, I'm getting an error that I hope is clearer to others, than me. I'm adding a grid to the example (form-grid-access.js in examples/form) and the errors I get are:

this.config[col] is undefined
chrome://firebug/content/blank.gif var width = this.config[col].width; ext-all-debug.js (line 49070)

this.mainBody is undefined
chrome://firebug/content/blank.gif this.mainBody.update(result).setWidth(this.getTotalWidth()); (line 47387)

which I believe means "there isn't a width" - yet the columnModel specifies widths.

Looking at the docs, I see that JsonReader has an idProperty not id (borrowed this config from another example that worked - in it's own context). Any help appreciated.

Ext.BLANK_IMAGE_URL = '../ext/resources/images/default/s.gif';

var OrdersDataStore = new Ext.data.Store({
id: 'OrdersDataStore',
proxy: new Ext.data.HttpProxy({
url: 'orders.php',
method: 'POST'
baseParams:{task: "LISTING"},
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'id'
{name: 'OrderID', type: 'int', mapping: 'order_id'},
{name: 'SuiteNo', type: 'string', mapping: 'suite_no'},
{name: 'Merchant', type: 'string', mapping: 'merchant'},
{name: 'TrackNo', type: 'string', mapping: 'track_no'},
{name: 'InvoiceNo', type: 'string', mapping: 'invoice_no'},
{name: 'Total', type: 'float', mapping: 'total'},
{name: 'Weight', type: 'float', mapping: 'weight'},
{name: 'UpdatedOn', type: 'date', dateFormat:'Y-m-d H:i:s', mapping: 'updated_on'},
{name: 'Status', type: 'string', mapping: 'status'}
sortInfo:{field: 'OrderID', direction: "ASC"}

var OrdersColumnModel = new Ext.grid.ColumnModel(
header: '#',
readOnly: true,
dataIndex: 'OrderID',
width: 40,
hidden: false
header: 'Suite #',
dataIndex: 'SuiteNo',
width: 50,
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 20,
maskRe: /([a-zA-Z0-9\s]+)$/
},{ ...