PDA

View Full Version : XMLStore



sogo
11 Oct 2010, 10:25 PM
Hi,
We are getting XML string from REST call to the server. Using this XML we are making our XmlStore, and using it to display in GridPanel.
However we are getting
this.proxy is undefined error.
our XmlStore looks like this:
storeEntityList = new Ext.data.XmlStore({
autoDestroy: true,
autoLoad: true,
root: 'Entities',
record: 'Serve',
fields: [{
name: 'host',
mapping: "//@host"
},
{
name: 'port',
mapping: "//@port"
},
{
name: 'status',
mapping: "//Parameter[@name='Status']"
},
{
name: 'total_size',
mapping: "//Parameter[@name='Size']"
}]
});

storeEntityList.loadData(xmlDoc);

And xmlDoc is like:
<Services>
<Serve host=”1.1.1.1” port=”9000”>
<Parameter name=”Status” type=”icon”>Starting</Parameter>
<Parameter name=”Size”>999</Parameter>
</Serve>
</Services>

If we define URL config option in store, it automatically configures a HttpProxy.
in this case how can we define Proxy config option in our xmlstore.we have XML string and not the URL?

Condor
12 Oct 2010, 1:47 AM
Do you have an XML string or an XML document?

If it is an XML document then you can use the 'data' config option or the loadData() method.

An XML string will first need to be converted to an XML document (Ext has no function for that, but the code for this has been posted on the forum several times).

m.gokul
12 Oct 2010, 4:02 AM
hello sir,
I am new to extJS.
How to store data submitted from the form to xml file.