English 中文(简体)
我无法创造第3级的分离。 树木
原标题:I can t manage to create 3rd level of dijit.Tree

我想设立3级<代码>dijit。 树冠/代码。

-root
|
--level1
 |
 --level2

I thought it would be really simple since there s a code snippet in this tutorial (example 1). But somehow I manage to fail. This is my dojo code (variable names are in Polish, I hope it s not a problem):

modelRaportow = new dijit.tree.ForestStoreModel({
    store: new dojo.data.ItemFileReadStore({
        url: "logika/getJSON/getStatusRaportow.php"
    }),
    query: {typ:  galaz },
    rootId:  statusRaportuRoot ,
    rootLabel:  Status raportu ,
    childrenAttrs:  raporty 
});

drzewoRaportow = new dijit.Tree({
    openOnClick: true,
    model: modelRaportow,
    showRoot: true,
    persist: false
}, "target-status-raportow");

drzewoRaportow.startup();

这是我通过<代码>logika/getJSON/getStatus Raportow.php返回的。 (波兰名):

{
    "identifier":"id",
    "label":"status",
    "items": [
        {"id":0,"status":"zaakceptowane","typ":"galaz"
            "raporty":[{"_reference":1},{"_reference":2},{"_reference":3}]},
                {"id":1,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":3,"status":"Raport0","typ":"lisc"},
                {"id":2,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":1,"status":"Raport1","typ":"lisc"},
                {"id":3,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":3,"status":"Raport2","typ":"lisc"},
        {"id":4,"status":"odrzucone","typ":"galaz"
            "raporty":[{"_reference":5},{"_reference":6},{"_reference":7}]},
                {"id":5,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":1,"status":"Raport3","typ":"lisc"},
                {"id":6,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":3,"status":"Raport4","typ":"lisc"},
                {"id":7,"data":"24-10-2011","wykonujacy":"cblajszczak","idKlienta":3,"status":"Raport5","typ":"lisc"}
]}

And finally, this is what I m getting: img - root node and lvl 1 nodes returned by query, no child nodes.

问题是——我的错误在哪里? 谁能看到?

最佳回答

我有部分答案:通过在类似情况下通过守则,我发现,它期望儿童。 a. 穿透阵列,因此应当:

childrenAttrs: [ raporty ]

但是,我仍然不能再说三。

问题回答

页: 1 页: 1





相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签