Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>EDIT</strong>: Forget about the <code>references</code>. You still have the problem described with the <code>children</code> attribute, but from looking at the source code for <code>QueryReadStore</code> and <code>TreeStoreModel</code> I don't see how it can ever work, at least in version 1.6. Also, see <a href="http://bugs.dojotoolkit.org/ticket/5876" rel="nofollow">http://bugs.dojotoolkit.org/ticket/5876</a> . It says there that you don't need references, and you can pass id values directly. But again, I'm not sure it'll work. You may need to subclass and override some methods from <code>QueryReadStore</code>.</p> <hr> <p>Your server script is returning an invalid value for the <code>children</code> attribute. It's returning <code>true</code> when it should return a list of references to other items, or the items themselves. Since in your case, you want to defer loading child items until expansion, the <code>children</code> attribute should have references. See <a href="http://dojotoolkit.org/reference-guide/dojo/data/ItemFileReadStore.html#item-structure" rel="nofollow">this</a> page in the Dojo reference guide.</p> <p>Something like:</p> <pre><code>{ "label":"name", "identification":"id", "items":[ { "id":3, "name":"Autobiographical" }, { "id":1, "name":"Blogging", "children": [ {_reference:100}, {_reference:101} ] }, ... ] } </code></pre> <p>Where ids <code>100</code> and <code>101</code> and not necessarily returned in the first batch of data, but can be fetched later, by performing new queries to your server.</p> <p>Also, the query in the <code>ForestTreeModel</code> should be something that returns your <strong>root</strong> items. <code>{id:0}</code> is not such a condition. You can add a dummy attribute <code>root</code> to all the returned items and set it to <code>true</code> for your roots. While <code>{id:0}</code> seems to work now, it might bite you later when the tree needs to requery the root items and the store uses the already loaded data.</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