tags:

views:

171

answers:

2

Can I access local xml files as data in jqgrid?

A: 

You want to access an XML file stored on the client's machine via Javascript? I don't think that can be done.

The more common scenario is pulling your XML via an AJAX call. I'd also look at the "local" option on the jqgrid wiki... you could embed your data as JSON/XML in the HTML page and read it in when setting up your jqgrid.

jtgameover
setting the local option means the data has to be an Array. How does it works on a plain XML?
prem
A: 

You can load the contain of the xml file in a string variable and use datatype: 'xmlstring' (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#xml_string). It will work.

Oleg
Thanks that helped me!
prem