PDA

View Full Version : Issue with panels drawing before XMLReader has completed loading data



slowmotiongenius
8 Feb 2012, 11:46 AM
I'm having an issue where I load data from an XML file to dynamically populate a carousel (and a list and a form).

I've looked at the carousel2 example in the docs (http://dev.sencha.com/deploy/touch/examples/carousel2/), and it's helped some. That example is limited as it only has a carousel on screen, not my kind of layout. An Hbox with a carousel, form, a list, and other components. The carousel2 example has the carousel created inside the store, and then added to the panel. This won't work for me will it? Am I supposed to create all of my components in the store and then add them to the panel there?

I've found I can use
storeXML.on('load',function(store,records,options){
//this fires after the xml store has finished loading}
To confirm when the store has been fully populated (meaning the XML has finished loading, but I think I'd like my page creation to pause until this has happened.

Otherwise, screen elements like panels and toolbars are being drawn that need to be linked up to the fully populated XML Data Store.

How is it recommended this kind of thing be accomplished?

I haven't seen much related to this idea out there, so ideas would be awesome. Thanks!

mitchellsimoens
8 Feb 2012, 12:23 PM
Create the panel or carousel or whatever on store load then. Or add items on store load.