I need to create a TitleBar which is sucked into a set of screens. The TitleBar elements are drop-down lists. The items within the drop-down lists must be dynamic and must be loaded from a data file.

My problem: the bit of code that reads the data file should be one the first instructions to be executed while, in reality, it is the last bit of code to be executed. This generates an empty item list for my drop-down(s).

This is my code. Please note that the functionality is far from being complete and the code might not make sense entirely.

//Important: note the fact that OrganizationStore is not called using all its name (do that and it does not load ... God knows why)
//PROBLEM: THIS LOOP IS EXECUTED AS LAST THING IN THIS CLASS
Ext.getStore('OrganizationStore').load(function(organizationList) {