Reputation: 178
I have a Perl script which returns an XML formatted SOAP request to my EXTJS4. Here is the code that loads and displays the XML (this is my first go at EXTJS):
Ext.onReady(function() {
Ext.Loader.setConfig({enabled:true});
Ext.define('accounts', {
extend: 'Ext.data.Model',
fields: [
{name: 'name', type: 'string'},
{name: 'origin', type: 'string'}
]
});
var myStore = Ext.create('Ext.data.Store', {
model: 'accounts',
proxy: {
type: 'ajax',
url: 'cgi-bin/runPerl.pl',
reader: {
type: 'xml',
root: 'soap:Body'
}
},
autoLoad: true
});
myStore.on('load', function(store, records, options) {
var tpl = new Ext.XTemplate(
'<tpl for="Accounts">',
'<h1>{values.data.name}</h1>',
'<h1>{values.data.origin}</h1>',
'</tpl>'
);
//tpl.append(Ext.get("output"), store.getRange());
});
Here is the XML:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:getAccountsResponse xmlns:ns2="http://services.nms.nimsoft.com/">
<Accounts>
<accountId>1</accountId>
<address></address>
<city></city>
<country></country>
<creationDate>2012-04-11T00:00:00+01:00</creationDate>
<description></description>
<fax></fax>
<name>Network</name>
<origin>Support_4</origin>
<phone></phone>
<postalCode></postalCode>
<state></state>
<webSite></webSite>
</Accounts>
</ns2:getAccountsResponse>
</soap:Body>
</soap:Envelope>
Firebug displays the following:
Ext.DomQuery.pseudos[name] is not a function
[Break On This Error]
return Ext.DomQuery.pseudos[name](cs, value);
I have narrowed this down to the tpl section but for the life of me cannot understand the error I am getting.
Can anyone offer advise please? Thanks!
Upvotes: 1
Views: 1158
Reputation: 17860
Try to change your reader definition as:
reader: {
type: 'xml',
// root: 'soap:Body',
record: 'Accounts'
}
Upvotes: 1