PDA

View Full Version : Grid Not Showing XML Data in all browsers bar Firefox



gohf
2 May 2010, 6:02 AM
Hi Everyone,

I hope somebody can help me, I have created a grid and XML Store that seems to work perfectly in Firefox but not in any other browser. I belive its all standard code, included is a cutdown version that demonstrates my problem.

As i say this works perfectly in firefox, I have tried in IE8 and Google Chrome, both of which disaply the grid but do not display any data. I have checked that they both do get the data from the configured URL.

var viewport = new Ext.Viewport({
layout: 'fit',
items: [
{
xtype: 'grid',
id: 'grid',
title: 'test',
columns: [
{ xtype: 'gridcolumn', header: 'Name', sortable: true, resizeable: true, dataIndex: 'Name', filterable: true },
{ xtype: 'gridcolumn', header: 'Street', sortable: true, resizeable: true, dataIndex: 'Address1', filterable: true },
{ xtype: 'gridcolumn', header: 'Locale', sortable: true, resizeable: true, dataIndex: 'Address2', filterable: true },
{ xtype: 'gridcolumn', header: 'Town', sortable: true, resizeable: true, dataIndex: 'Town', filterable: true },
{ xtype: 'gridcolumn', header: 'County', sortable: true, resizeable: true, dataIndex: 'County', filterable: true },
{ xtype: 'gridcolumn', header: 'Postcode', sortable: true, resizeable: true, dataIndex: 'Postcode', filterable: true }
],
store: {

xtype: 'xmlstore',
storeId: 'gridstore_1',
url: 'API/_Address',
autoLoad: true,
idPath: '_AddressID',
record: '_Address',
totalRecords: '@total',
fields: [
{ name: '_AddressID', mapping: '_AddressID', type: 'numeric' },
{ name: 'Name', mapping: 'Name', type: 'string' },
{ name: 'Address1', mapping: 'Address1', type: 'string' },
{ name: 'Address2', mapping: 'Address2', type: 'string' },
{ name: 'Town', mapping: 'Town', type: 'string' },
{ name: 'County', mapping: 'County', type: 'string' },
{ name: 'Postcode', mapping: 'Postcode', type: 'string'}
]
}
}
]
});

gohf
2 May 2010, 6:31 AM
There was me pulling my hair out over my code and it turns out that this is a simple Mime Type issue. The returned XML had a text\XML rather than text/XML.

Simply looks like Firefox is not fussy, whereas the other browsers are.