PDA

View Full Version : How to read XML files in ExtJS locally?



mrkadakia
21 Jul 2009, 5:29 AM
Hi all -
I am using ExtJS locally for development.

The XML Grid Example on the Samples page runs fine:

http://extjs.com/deploy/dev/examples/grid/xml-grid.html

but when I try to run the same example from the extjs directory, the XML data does not get loaded:

ext-2.2\examples\grid\xml-grid.html

This is a major roadblock to me. Could someone suggest me on how can I run these examples locally?

Thanks

Condor
21 Jul 2009, 5:30 AM
Publish them on a local webserver (Apache?).

(or you could use the ext-basex user extension to add local file access support)

mrkadakia
21 Jul 2009, 5:36 AM
Hi Condor,
Thank you for your response.

I would like to use ext-basex user extension but I do not know how to use it.

I had found a thread by Doug Hendricks:

http://extjs.com/forum/showthread.php?p=52350#post52350

but it has so many posts that it is turning out to be really difficult to follow. So, if you don't mind, I would appreciate if you could tell me in simple steps on what should I do to run these XML examples locally?

Thanks

tryanDLS
21 Jul 2009, 5:59 AM
If you can't read/follow that thread, I would say you shouldn't be using that extension. Start from the top of it and look at Doug's examples and code. It's not difficult to use if you take the time to understand it.

mrkadakia
21 Jul 2009, 6:04 AM
tryanDLS,
You are referring to the following thread right?

http://extjs.com/forum/showthread.php?t=21681

Earlier, I pasted the thread on localXHR.js and then I later realized that there is a separate thread on Ext-baseX.

Correct me if I am wrong.

Thanks

Condor
21 Jul 2009, 9:45 AM
Use the ext-basex.js file from this post (http://www.extjs.com/forum/showthread.php?t=70396).

ps. You might need to set:

Ext.lib.Ajax.forceActiveX = true;
to make Ext use ActiveX for IE instead of XmlHttpRequest (which doesn't support local file access).
Also, in Firefox you can only access file below your current directory (or you need to change a security.fileuri.strict_origin_policy in about:config).

mrkadakia
21 Jul 2009, 10:09 AM
Condor,
Thank you so much for the instructions. I was able to get it working.

Great support!

headkit
23 Aug 2011, 7:57 AM
what about OSX/safari?

extdev22
4 Oct 2012, 12:32 PM
for the same purpose loading\reading files locally?