English 中文(简体)
利用Dijit。 with with 树
原标题:Using Dijit.Tree with QueryReadStore for Lazy Loading

I m试图使用Dojox.data。 QueryReadStore是一家 la装的仓库。 树木。 我似乎难以找到使用该仓库的人而不是JsonRestStore的例子,但为了在我的整个申请中保持一致,我真的要坚持使用电梯而不是REST syntax。 问题在于,尽管我能够让QueryReadStore穿过树根层, la装孩子,但总是失败。

这里我要说的是:

        dojo.require("dojox.data.QueryReadStore");
        dojo.require("dijit.Tree");



        dojo.addOnLoad(function() {
            var store = new dojox.data.QueryReadStore({
                url: /cgi-bin/safari/safari_json_responder.pl ,
                requestMethod: "get"
            });

            var treeModel = new dijit.tree.ForestStoreModel({
                store: store,
                deferItemLoadingUntilExpand: true,
                query: {  id  : "0" },
                childrenAttrs: ["children"]
            });

            var myTree = new dijit.Tree({
                model: treeModel
            },
            "treeOne");

            myTree.startup();

        });

在我点击扩大有子女的类别之一时,我从火焰中看到这一错误:

Node cannot be inserted at the specified point in the hierarchy" code: "3 [Break On This Error] (function(){var _1=null;if((_1||(typeo...setTimeout(dojo._loadInit,100);}})();

Any suggestions on what might be the issue? You can see the live test page here:

rel=“nofollow” http://asisaid.com/safari-resources/lazyLoad.html

www.un.org/Depts/DGACM/index_spanish.htm 最新意见 19-Jun-2011年:

我注意到,KeryReadStore似乎声称不完整。 也许称QueryReadStore能够处理zy装问题的乔文件是不正确的? 我曾试图取代QueryReadStore。 它是低温分解方法,但却没有能够表明其作用。 我试图寻找“债务”或“优惠”的属性,但似乎并没有奏效。

显然,我做了一些错误的事情。 尽管我感到有些how,但我还是认为我是正确的。 如果我可以通知模型,某一项物品的装满负荷,或许会按其应当(以及JsonRestStore)采取行动。

这里,当将id=0传送到服务器时,数据即为产出:

{"label":"name","identification":"id","items":[{"name":"Autobiographical","poid":"0","id":"3"},{"name":"Blogging","poid":"0","children":[{"name":"asisaid","id":"2","$ref":"2"},{"name":"blogware","id":"4","$ref":"4"}],"id":"1","$ref":"1"}, [...]

(为避免太长时间而中断)

我在这里和在试图制造不同东西时都投下了参考资料和数据(我确信,我在这个例子中太多了,但我却试图扔下一切,看看着什么 stick。

It originally looked like this for id=0:

{"label":"name","identification":"id","items":[{"name":"Autobiographical","poid":"0","id":"3"},{"name":"Blogging","poid":"0","children": "true","id":"1","$ref":"1"}, [...]

我也试图这样做:

{"label":"name","identification":"id","items":[{"name":"Autobiographical","poid":"0","id":"3"},{"name":"Blogging","poid":"0","children": [{"$ref":"2" },{"$ref":"4"}],"id":"1"}, [...]

None of these ideas (nor the same thing, but using "_reference" instead of "$ref" seems to do the trick.

问题回答

www.un.org/Depts/DGACM/index_spanish.htm 关于<代码>参比/代码>的参比。 您仍然有<儿童编码> /编码>属性,但从查阅<代码>的源代码来看。 QueryReadStore和TreeStoreModel 我看不出它如何工作,至少是第1.6版。 另见。 它说,你不需要提及,你可以直接通过id。 但是,我再说不相信它会失败。 您可能需要从<条码>中分级并优先于某些方法。 QueryReadStore。


Your server script is returning an invalid value for the children attribute. It s returning true 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 children attribute should have references. See this page in the Dojo reference guide.

类似:

{
  "label":"name",
  "identification":"id",
  "items":[
    {
      "id":3,
      "name":"Autobiographical"
    },
    {
      "id":1,
      "name":"Blogging",
      "children": [
        {_reference:100}, {_reference:101}
      ]
    },
    ...
  ]
}

用户:100101,不一定在数据的第一批中填报,但以后可以通过向服务器进行新的查询重新排列。

此外,<代码>中的查询 ForestTreeModel 页: 1 <代码>{id:0}不是这样的条件。 您可在所有返还物品上添加一个 du子特性:root,并将其打入true。 www.un.org/Depts/DGACM/index_spanish.htm 现在看来,当树木需要重新排列根块并使用已经装满的数据时,这可能会使你 b。





相关问题
Get Dojo Radio Button Value?

I have an HTML form using dojo and have the following code for a radio button selection choice: dojo.require("dijit.form.RadioButton"); <link href="http://ajax.googleapis.com/ajax/libs/dojo/1....

is it possible to know if a dijit is displayed or not?

i have two divs on a page. each has several dijits. i have atoggle that shows only one div or the other. when i submit the form, i only want to validate the dijits that are in the div that is ...

dijit BorderContainer auto-grow

Is there a way to have a dijit.layout.BorderContainer auto-grow in height? I ve tried setting min-height: 200px; height: auto;, but it won t scale. I ve tried looking at the API, but that thing is a ...

Dojo Tabs as Custom Widgets

I ve created a number of widgets that are loaded as tab panes in a tabcontainer. Everything seems to work well, except I m getting different results when using my custom widgets vs. creating ...

What happened to Dojo DOH?

The Dojo Toolkit used to come with a testing facility called "Doh". It was in the /utils directory. Now when you download dojo-release-1.3.2 the /utils directory is nowhere to be found. Is Doh dead ...

热门标签