View Full Version : Grid Array Not working - IE shows DOM is null or not an object

5 Aug 2009, 9:25 PM
Hello, I was trying to run the example of grid-array provided in Ext tutorials. When run in IE it gives a 'DOM null or not an object' error. When run in Mozilla it gives no display. Here i m attaching the code snippet. I get an alert after it prints alert("33"); Ext.onReady(function(){ alert("11"); var myData = [ ['Apple',29.89,0.24,0.81,'9/1 12:00am'], ['Ext',83.81,0.28,0.34,'9/12 12:00am'], ['Google',71.72,0.02,0.03,'10/1 12:00am'], ['Microsoft',52.55,0.01,0.02,'7/4 12:00am'], ['Yahoo!',29.01,0.42,1.47,'5/22 12:00am'] ]; alert("22"); var myReader = new Ext.data.ArrayReader({}, [ {name: 'company'}, {name: 'price', type: 'float'}, {name: 'change', type: 'float'}, {name: 'pctChange', type: 'float'}, {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'} ]); alert("33"); var grid = new Ext.grid.GridPanel({ store: new Ext.data.Store({ data: myData, reader: myReader }), columns: [ {header: 'Company', width: 120, sortable: true, dataIndex: 'company'}, {header: 'Price', width: 90, sortable: true, dataIndex: 'price'}, {header: 'Change', width: 90, sortable: true, dataIndex: 'change'}, {header: '% Change', width: 90, sortable: true, dataIndex: 'pctChange'}, {header: 'Last Updated', width: 120, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} ], viewConfig: { forceFit: true }, renderTo: 'content', title: 'My First Grid', width: 500, autoHeight: true, frame: true }); alert("444"); grid.getSelectionModel().selectFirstRow(); grid.render('grid-example'); alert("Ext loaded successfully"); });

5 Aug 2009, 10:03 PM
Can YOU read the "code" above?

Is this an "Example" or and "Extra"?

5 Aug 2009, 10:14 PM
I have tried to format the code; but couldn't find any help for formatting while posting it. Could u plz tell me where is the formatting option available?

5 Aug 2009, 10:29 PM
If you'd been looking for Help in the Help folder, you'd have seen this: