PDA

View Full Version : Timing Problem



Cake4k
27 Feb 2014, 8:49 AM
Hello,

i got a huge problem:

We have an Application which was running perfectly in dev Mode. Today we tried to build the application and we recognized that there were "Requires" missing (errors while or after compiling). Adding the "Requires" brings a new problem which is about timings.

There is an extj class "enviroment (singleton)" which holds data and has multiple functions. One function get started by an controller which makes an ajax call (data gets set). The second function check for "permissions/roles".
Now while everything gets required, multiple stores, views ask the enviroment class for permission. Because the data is not set there are multiple errors.

Example:
Ext.define('sharesuite.store.dms.ExplorerTreeStore', {
...
root : {
expanded : true,
name : "Root-Ebene",
allowDrop : Enviroment.hasRole('ADMIN')
},
...
});

What are the options to fix this?

sincerly
cake

Gary Schlosberg
4 Mar 2014, 8:40 AM
Difficult to say without more information. In general, you obviously want to get that data loaded before trying to use it. Can you use events to control that or perhaps check for admin privileges before the store loads?