matevans
5 Aug 2008, 3:20 AM
Hi,
I was wondering if anyone can give me a hand. Keep getting an error during runtime in AIR.
Using the xml grid example, should this work if it's just copied into AIR? i've added all the appropriate js files (including ext.air) and they're all in the correct order.
The error I get is "Type error: null value - line 76 ext-all.js"
I don't really know where to start hunting this one down, ext-all is way to big.
the code is
Ext.onReady(function(){
// create the Data Store
var store = new Ext.data.Store({
// load using HTTP
url: 'sheldon.xml',
// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'Item',
id: 'ASIN',
totalRecords: '@total'
}, [
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Author', mapping: 'ItemAttributes > Author'},
'Title', 'Manufacturer', 'ProductGroup'
])
});
// create the grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{header: "Author", width: 120, dataIndex: 'Author', sortable: true},
{header: "Title", width: 180, dataIndex: 'Title', sortable: true},
{header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
{header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
],
renderTo:'example-grid',
width:540,
height:200
});
store.load();
});
Am I missing something really obvious??
Thanks in advance!
Mat Evans
I was wondering if anyone can give me a hand. Keep getting an error during runtime in AIR.
Using the xml grid example, should this work if it's just copied into AIR? i've added all the appropriate js files (including ext.air) and they're all in the correct order.
The error I get is "Type error: null value - line 76 ext-all.js"
I don't really know where to start hunting this one down, ext-all is way to big.
the code is
Ext.onReady(function(){
// create the Data Store
var store = new Ext.data.Store({
// load using HTTP
url: 'sheldon.xml',
// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'Item',
id: 'ASIN',
totalRecords: '@total'
}, [
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Author', mapping: 'ItemAttributes > Author'},
'Title', 'Manufacturer', 'ProductGroup'
])
});
// create the grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{header: "Author", width: 120, dataIndex: 'Author', sortable: true},
{header: "Title", width: 180, dataIndex: 'Title', sortable: true},
{header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
{header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
],
renderTo:'example-grid',
width:540,
height:200
});
store.load();
});
Am I missing something really obvious??
Thanks in advance!
Mat Evans