PDA

View Full Version : Grid and XML in IE and Firefox



sigidadon
28 May 2007, 3:44 AM
Hi,
I have a grid getting it's data as ajax result.responseXML when the page is being loaded.
In firefox - the grid looks great with all the information whereas in IE i get an empty grid.
the data is being loaded as

grid.getDataSource().loadData(result.responseXML);
when the XML is being loaded as a file by:

var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '/site/ext/demo3.xml' // a real xml file
}),
reader: new Ext.data.XmlReader({
record: 'entries',
id: 'value > id'
}, [{name: 'owner', mapping: 'value > owner'},
'status', 'description', 'client'
])
});
ds.load({params:{start: paging.cursor, limit: paging.pageSize}});
- the XML is being loaded to the IE just fine.
any ideas?
Thanks!

Animal
28 May 2007, 4:30 AM
You can't page a static file.

The "start" and "limit" parameters mean "start from row n", and "only pass back n rows". Unless you wrap that file with a servlet/script than can do that for you, you will not be able to page it.

So you will not be able to have a PagingToolbar.

So just use



ds.load();

sigidadon
28 May 2007, 5:32 AM
thanks!
but how you attach the the responseXml to the data source?

Animal
28 May 2007, 6:16 AM
you don't. That's the whole point! The Store is handed the DataProxy object and the Reader, and it loads itself.

sigidadon
28 May 2007, 6:50 AM
i think you didn't understand my problem, but thanks a lot for replying!

the problem was that the response header was missing the 'content-type: text/xml'.
it seems like a familiar issue of ajax in IE against other browsers.

Animal
28 May 2007, 7:22 AM
"how you attach the the responseXml to the data source?"

I thought that was your problem.