Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Dojo comboBox not finding dojo.data
    primarykey
    data
    text
    <p>I am trying to get a dojo comboBox working in Zend, with the following code:</p> <pre><code>$url = '/db/autocomplete/table/suburbs'; $element = new Zend_Dojo_Form_Element_ComboBox('suburb1'); $element-&gt;setStoreId('suburbsStore'); $element-&gt;setStoreType('dojo.data.ItemFileReadStore'); $element-&gt;setStoreParams(array('url' =&gt; $url)); $element-&gt;setDijitParam('searchAttr', 'name'); </code></pre> <p>and the output is this javascript (I've reformatted it a bit):</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dojo/dojo.xd.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;//&lt;![CDATA[ dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.form.ComboBox"); dojo.require("dojo.parser"); dojo.addOnLoad(function() { dojo.forEach(zendDijits, function(info) { var n = dojo.byId(info.id); if (null != n) { dojo.attr(n, dojo.mixin({ id: info.id }, info.params)); } }); dojo.parser.parse(); }); var suburbsStore = new dojo.data.ItemFileReadStore({"url":"\/db\/autocomplete\/table\/suburbs"}); var zendDijits = [ {"id":"suburb1","params":{ "store":"suburbsStore", "searchAttr":"name", "dojoType":"dijit.form.ComboBox"} }, {"id":"suburb2","params":{ "store":"suburbsStore", "searchAttr":"name", "dojoType":"dijit.form.ComboBox"} } ]; //]]&gt;&lt;/script&gt; </code></pre> <p>and this HTML (with extraneous stuff removed):</p> <pre><code>&lt;input options="" id="suburb1" name="suburb1" value="" type="text" /&gt; &lt;input options="" id="suburb2" name="suburb2" value="" type="text" /&gt; &lt;input type="submit" /&gt; </code></pre> <p>and the error I'm getting is <strong>dojo.data is undefined</strong> on the <code>var suburbsStore = new dojo.data.ItemFileReadStore(...)</code> line. Surely that call is after <code>dojo.require("dojo.data.ItemFileReadStore");</code> and so should be fine?! But obviously I'm missing something.</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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