Hi Alex, I tried your code snippet with a minimal sample and I couldn't get it to run... I embedded the code below into the standard qooxdoo stub:
--snip--
var url = "http://www.catify.com/demo/json/dummy.json";
var jsonStore = new qx.data.store.Json(url);
jsonStore.addListener("loaded", function(e)
{
// model is created at this point
// and the data of the given event ('e' parameter)
// is the created model
this.doSomethingWithTheModel(e.getData());
}, this);
},
doSomethingWithTheModel: function(model){
alert(model);
}
--snip--
The json document is really simple, too:
{
foo: "foo",
bar: "bar"
}
If I call the index page, nothing will happen - no exception reported be
firebug, but no 'alert' window, too. Can you (or anyone else) give me a hint,
where the mistake is?
Thanks in advance - Claus
Am Freitag, den 20.08.2010, 13:53 +0200 schrieb Alexander Steitz:
> Hi Claus,
>
> Am 20.08.2010 11:00, schrieb Claus Straube:
> > you're right. I put the json on our webserver and voila - it worked.
> > Sorry for wasting your time with stupid copy and paste errors.
> No problem. It's better you ask and get your problem solved :)
>
> > The store is initialized, but the model is still "null". Should it not
> > "autogenerated" from the store? Or is this a missunderstanding from my
> > side?
> The store does fetch the data using the URL and then automatically
> creating the model for you. This is done asynchronously, so maybe you're
> asking too early for a model, because the data is not loaded yet.
>
> You can use the "loaded" event to check when the model is created.
>
> --snip--
> var jsonStore = new qx.data.store.Json(myUrl);
> jsonStore.addListener("loaded", function(e)
> {
> // model is created at this point
> // and the data of the given event ('e' parameter)
> // is the created model
> var model = e.getData();
>
> // more lines of code
> }, this);
> --snip--
>
> I hope this helps you further.
>
> cheers,
> Alex
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
