Hello Stefan,
> first of all congratulation to QooxDoo 3.0 - great job !

Thanks. :)

> I'm using a JSON file with the following structure.  
> 
> {
>    "name": "Test Suites",
>    "children": [
>        {
>            "name": "ContiTeves",
>            "children": [
>                {
>                    "name": "ESC10",
>                    "option": "-X0 -Xsize-opt",
>                    "desc": "Test description contains details regarding the
> purpose of the test"
>                }
>            ]
>        }
>    ]
> }
> 
> The details are show in a Virtual.Tree. 
> // **********************************************************************
> //  loads the tree model
> // **********************************************************************     
>           
>     var url = "json/tests.json";
>     var store = new qx.data.store.Json(url);
>     var dataModel = store.getModel();
>    this.__store = store;
>    // connect the store and the tree
>      store.bind("model", abc_test, "model");
> 
> This works !!! Now the question.
> I would like to access fields like "name", "option" and "desc". 
> Using 
>                       var itemModel = data[0].getModel().getName();
>                        var name = itemModel.getValue();
>  works nice, but I can't access the other fields ...

Well, I guess you can if they are available. But as your structure shows, the 
other fields seem to be optional and therefore, not available on every model 
item. This means that the accessor-methods won't be available on every item as 
well. So you have a bunch of options: 
1. use duck-typing to check if any accessor is available
2. use a custom model class for every item which will hold null values for you
3. change the data to contain the fields with null values

Regards,
Martin
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to