Note that there are some explanatory texts on larger screens.

plurals
  1. POEXTJS4 XML Store - Displaying
    text
    copied!<p>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):</p> <pre><code>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( '&lt;tpl for="Accounts"&gt;', '&lt;h1&gt;{values.data.name}&lt;/h1&gt;', '&lt;h1&gt;{values.data.origin}&lt;/h1&gt;', '&lt;/tpl&gt;' ); //tpl.append(Ext.get("output"), store.getRange()); }); </code></pre> <p>Here is the XML:</p> <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body&gt; &lt;ns2:getAccountsResponse xmlns:ns2="http://services.nms.nimsoft.com/"&gt; &lt;Accounts&gt; &lt;accountId&gt;1&lt;/accountId&gt; &lt;address&gt;&lt;/address&gt; &lt;city&gt;&lt;/city&gt; &lt;country&gt;&lt;/country&gt; &lt;creationDate&gt;2012-04-11T00:00:00+01:00&lt;/creationDate&gt; &lt;description&gt;&lt;/description&gt; &lt;fax&gt;&lt;/fax&gt; &lt;name&gt;Network&lt;/name&gt; &lt;origin&gt;Support_4&lt;/origin&gt; &lt;phone&gt;&lt;/phone&gt; &lt;postalCode&gt;&lt;/postalCode&gt; &lt;state&gt;&lt;/state&gt; &lt;webSite&gt;&lt;/webSite&gt; &lt;/Accounts&gt; &lt;/ns2:getAccountsResponse&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>Firebug displays the following:</p> <pre><code>Ext.DomQuery.pseudos[name] is not a function [Break On This Error] </code></pre> <p>return Ext.DomQuery.pseudos[name](cs, value);</p> <p>I have narrowed this down to the tpl section but for the life of me cannot understand the error I am getting.</p> <p>Can anyone offer advise please? Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload