- /**
- * Build the registered modules.
- * @param {Object} parent element.
- * @param {Function} optional method to call after module has been added.
- *
- */
-
- build : function()
- {
-
- this.preBuild();
- var mods = this.buildOrder();
-
- //this.allmods = mods;
- //console.log(mods);
- //return;
- if (!mods.length) { // should not happen
- throw "NO modules!!!";
- }
-
-
-
- // flash it up as modal - so we store the mask!?
- Roo.MessageBox.show({ title: 'loading' });
- Roo.MessageBox.show({
- title: "Please wait...",
- msg: "Building Interface...",
- width:450,
- progress:true,
- closable:false,
- modal: false
-
- });
- var n = -1;
- var _this = this;
- var progressRun = function() {
- n++;
- if (n >= mods.length) {
- Roo.MessageBox.hide();
- _this.topModule.fireEvent('built', _this.topModule);
- return;
- }
-
- var m = mods[n];
-
-
- Roo.MessageBox.updateProgress(
- (n+1)/mods.length, "Building Interface " + (n+1) +
- " of " + mods.length +
- (m.name ? (' - ' + m.name) : '')
- );
-
- if (typeof(m) == 'function') {
- m.call(this);
- progressRun.defer(10, _this);
- return;
- }
- var disabled = (typeof(m.module.disabled) == 'function') ?
- m.module.disabled.call(m.module.disabled) : m.module.disabled;
-
- }
-
- if (m.parent.layout && !disabled) {
- // modules have to support a 'add method'
- // should we just move that code into here..
- m.module.add(m.parent.layout, m.region);
- }
-
-
-
- }
- progressRun.defer(1, _this);
-
-
-
- }
-
-
-
-
-});
-
\ No newline at end of file