From: Alan Knowles Date: Wed, 15 Jun 2011 04:42:52 +0000 (+0000) Subject: Roo.form.DisplayField - add x-for-displayfield css class X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=f1743407b82c506c3dd6638b5d9263d68220ca85 Roo.form.DisplayField - add x-for-displayfield css class --- diff --git a/Roo/form/DisplayField.js b/Roo/form/DisplayField.js index 672841dbd9..8b77ac0bfe 100644 --- a/Roo/form/DisplayField.js +++ b/Roo/form/DisplayField.js @@ -76,7 +76,7 @@ Roo.extend(Roo.form.DisplayField, Roo.form.TextField, { //if(this.inputValue !== undefined){ this.wrap = this.el.wrap(); - this.viewEl = this.wrap.createChild({ tag: 'div'}); + this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'}); if (this.bodyStyle) { this.viewEl.applyStyles(this.bodyStyle); diff --git a/css/form.css b/css/form.css index eeba77cf85..a161845e14 100644 --- a/css/form.css +++ b/css/form.css @@ -18,7 +18,9 @@ position: relative; z-index: 2; } - +.x-form-displayfield { + padding-top: 3px; +} .x-form-label-right label { text-align: right; diff --git a/roojs-all.js b/roojs-all.js index a3510401c3..c61e7726be 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -773,7 +773,7 @@ Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(th this.grid=new Roo.grid[this.xgrid.xtype](this.viewEl,this.xgrid);this.grid.render();this.grid.getDataSource().on('remove',this.refreshValue,this);this.grid.getDataSource().on('update',this.refreshValue,this);this.grid.on('afteredit',this.refreshValue,this);},setValue:function(v){v=v||[];if(this.grid&&this.grid.getDataSource()&&typeof(v)!='undefined'){var ds=this.grid.getDataSource();var A={} A[ds.reader.meta.root]=typeof(v)=='string'?Roo.decode(v):v;ds.loadData(A);} Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var A=[];this.grid.getDataSource().each(function(r){A.push(r.data);});this.el.dom.value=Roo.encode(A);}}); -Roo.form.DisplayField=function(A){Roo.form.DisplayField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DisplayField,Roo.form.TextField,{inputType:'hidden',allowBlank:true,readOnly:true,focusClass:undefined,fieldClass:'x-form-field',valueRenderer:undefined,width:100,onResize:function(){Roo.form.DisplayField.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.DisplayField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap();this.viewEl=this.wrap.createChild({tag:'div'});if(this.bodyStyle){this.viewEl.applyStyles(this.bodyStyle);} +Roo.form.DisplayField=function(A){Roo.form.DisplayField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DisplayField,Roo.form.TextField,{inputType:'hidden',allowBlank:true,readOnly:true,focusClass:undefined,fieldClass:'x-form-field',valueRenderer:undefined,width:100,onResize:function(){Roo.form.DisplayField.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.DisplayField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap();this.viewEl=this.wrap.createChild({tag:'div',cls:'x-form-displayfield'});if(this.bodyStyle){this.viewEl.applyStyles(this.bodyStyle);} this.setValue(this.value);},onClick:function(){},setValue:function(v){this.value=v;var A=this.valueRenderer?this.valueRenderer(v):String.format('{0}',v);if(!this.viewEl){return;} this.viewEl.dom.innerHTML=A;Roo.form.DisplayField.superclass.setValue.call(this,v);}}); Roo.form.DayPicker=function(A){Roo.form.DayPicker.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DayPicker,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},actionMode:'viewEl',inputType:'hidden',inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-daypick-item '});var r1='';var r2='';for(var i=0;i<7;i++){r1+='';r2+='';}var B=this.wrap.createChild(r1+''+r2+'
'+Date.dayNames[i].substring(0,3)+'
');B.select('img').on('click',this.onClick,this);this.viewEl=B;this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);},initValue:Roo.emptyFn,getValue:function(){return this.el.dom.value;},onClick:function(e){Roo.get(e.target).toggleClass('x-menu-item-checked');this.refreshValue();},refreshValue:function(){var A='';this.viewEl.select('img',true).each(function(e,i,n){A+=e.is(".x-menu-item-checked")?String(n):'';});this.setValue(A,true);},setValue:function(v,A){if(!this.el.dom){return;}var B=this.el.dom.value;this.el.dom.value=v;if(A){return;} @@ -952,12 +952,11 @@ Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,argumen D.push({id:id,target:G,exec:F,test:fn,body:m[1]||''});s=s.replace(m[0],'{xtpl'+id+'}');++id;}for(var i=D.length-1;i>=0;--i){this.compileTpl(D[i]);} this.master=D[D.length-1];this.tpls=D;};Roo.extend(Roo.XTemplate,Roo.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applySubTemplate:function(id,A,B){var t=this.tpls[id];if(t.test&&!t.test.call(this,A,B)){return '';}if(t.exec&&t.exec.call(this,A,B)){return '';}var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;iString(b).toUpperCase()?1:-1;};if(!this.topModule||!this.topModule.modules){throw "No top level modules to build";}var C=[this.topModule];var D=function(m){C.push(m);if(m.modules){m.modules.keySort('ASC',B);m.modules.each(D);}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}} -this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);return C;},build:function(){this.preBuild();var A=this.buildOrder();if(!A.length){throw "NO modules!!!";} -Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:"Building Interface...",width:450,progress:true,closable:false,modal:false});var B=A.length;var C=this;var D=function(){if(!A.length){Roo.debug&&Roo.log('hide?');Roo.MessageBox.hide();C.topModule.fireEvent('buildcomplete',C.topModule);return;}var m=A.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return D.defer(10,C);}Roo.MessageBox.updateProgress((B-A.length)/B,"Building Interface "+(B-A.length)+" of "+B+(m.name?(' - '+m.name):''));var E=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(E){return D();}if(!m.parent){var F=new Ext.BorderLayout(document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,minTabWidth:140}});var G=m.tree();G.region='center';m.el=F.addxtype(G);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);}var G=m.tree();G.region=G.region||m.region;m.el=m.parent.el.addxtype(G);m.fireEvent('built',m);m.panel=m.el;m.layout=m.panel.layout;D.defer(10,C);} +o=o[e];});return o;},preBuild:function(){Roo.each(this.modules,function(A){A.parent=this.toObject(A.parent);if(!A.parent){this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});} +A.parent.modules.add(A);},this);},buildOrder:function(){var A=this;var B=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;};if((!this.topModule||!this.topModule.modules)&&!this.elmodules.length){throw "No top level modules to build";}var C=this.topModule?[this.topModule]:[];Roo.each(this.elmodules,function(e){C.push(e)});var D=function(m){C.push(m);if(m.modules){m.modules.keySort('ASC',B);m.modules.each(D);}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}};if(this.topModule){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);}return C;},build:function(){this.preBuild();var A=this.buildOrder();if(!A.length){throw "NO modules!!!";} +Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:"Building Interface...",width:450,progress:true,closable:false,modal:false});var B=A.length;var C=this;var D=function(){if(!A.length){Roo.debug&&Roo.log('hide?');Roo.MessageBox.hide();if(C.topModule){C.topModule.fireEvent('buildcomplete',C.topModule);}return false;}var m=A.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return D.defer(10,C);}Roo.MessageBox.updateProgress((B-A.length)/B,"Building Interface "+(B-A.length)+" of "+B+(m.name?(' - '+m.name):''));var E=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(E){return D();}if(!m.parent||(typeof(m.parent)=='string'&&m.parent[0]=='#')){var F=m.parent?Roo.get(m.parent.substr(1)):document.body;if(!F){Roo.log("not rendering module "+m.name+" "+m.parent+" no found");return D.defer(10,C);}var G=new Ext.BorderLayout(m.parent?Roo.get(m.parent.substr(1)):document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:m.parent?false:true,hideTabs:m.parent?true:false,minTabWidth:140}});var H=m.tree();H.region='center';m.el=G.addxtype(H);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);}var H=m.tree();H.region=H.region||m.region;m.el=m.parent.el.addxtype(H);m.fireEvent('built',m);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);} D.defer(1,C);}}); Roo.Login=function(A){this.addEvents({'refreshed':true});Roo.apply(this,A);Roo.onReady(function(){this.onLoad();},this);Roo.Login.superclass.constructor.call(this,this);} Roo.extend(Roo.Login,Roo.LayoutDialog,{method:'POST',url:'',user:false,checkFails:0,intervalID:0,onLoad:function(){if(Roo.get('loading')){Roo.get('loading').remove();} diff --git a/roojs-debug.js b/roojs-debug.js index eb2005f968..62e7fa197a 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -42670,7 +42670,7 @@ Roo.extend(Roo.form.DisplayField, Roo.form.TextField, { //if(this.inputValue !== undefined){ this.wrap = this.el.wrap(); - this.viewEl = this.wrap.createChild({ tag: 'div'}); + this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'}); if (this.bodyStyle) { this.viewEl.applyStyles(this.bodyStyle); @@ -51199,6 +51199,11 @@ Roo.XTemplate.from = function(el){ } ] *}) + * + * Roo.onReady(function() { + Roo.XComponent.build(); + }) + * * @extends Roo.util.Observable * @constructor * @param cfg {Object} configuration of component @@ -51280,8 +51285,6 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, { */ items : false - - }); Roo.apply(Roo.XComponent, { @@ -51304,12 +51307,18 @@ Roo.apply(Roo.XComponent, { /** * @property modules * array of modules to be created by registration system. - * @type Roo.XComponent + * @type {Array} of Roo.XComponent */ modules : [], + /** + * @property elmodules + * array of modules to be created by which use #ID + * @type {Array} of Roo.XComponent + */ + elmodules : [], /** * Register components to be built later. * @@ -51337,6 +51346,7 @@ Roo.apply(Roo.XComponent, { }, /** * convert a string to an object.. + * eg. 'AAA.BBB' -> finds AAA.BBB * */ @@ -51345,12 +51355,18 @@ Roo.apply(Roo.XComponent, { if (!str || typeof(str) == 'object') { return str; } + if (str[0]=='#') { + return str; + } var ar = str.split('.'); var rt, o; rt = ar.shift(); /** eval:var:o */ eval('if (typeof ' + rt + ' == "undefined"){ o = false;} o = ' + rt + ';'); if (o === false) { + + + throw "Module not found : " + str; } Roo.each(ar, function(e) { @@ -51379,6 +51395,10 @@ Roo.apply(Roo.XComponent, { this.topModule = obj; return; } + if (typeof(obj.parent) == 'string') { + this.elmodules.push(obj); + return; + } if (!obj.parent.modules) { obj.parent.modules = new Roo.util.MixedCollection(false, @@ -51402,12 +51422,13 @@ Roo.apply(Roo.XComponent, { return String(a).toUpperCase() > String(b).toUpperCase() ? 1 : -1; }; - if (!this.topModule || !this.topModule.modules) { + if ((!this.topModule || !this.topModule.modules) && !this.elmodules.length) { throw "No top level modules to build"; } - + // make a flat list in order of modules to build. - var mods = [ this.topModule ]; + var mods = this.topModule ? [ this.topModule ] : []; + Roo.each(this.elmodules,function(e) { mods.push(e) }); // add modules to their parents.. @@ -51426,8 +51447,10 @@ Roo.apply(Roo.XComponent, { } } - this.topModule.modules.keySort('ASC', cmp ); - this.topModule.modules.each(addMod); + if (this.topModule) { + this.topModule.modules.keySort('ASC', cmp ); + this.topModule.modules.each(addMod); + } return mods; }, @@ -51471,8 +51494,11 @@ Roo.apply(Roo.XComponent, { if (!mods.length) { Roo.debug && Roo.log('hide?'); Roo.MessageBox.hide(); - _this.topModule.fireEvent('buildcomplete', _this.topModule); - return; + if (_this.topModule) { + _this.topModule.fireEvent('buildcomplete', _this.topModule); + } + // THE END... + return false; } var m = mods.shift(); @@ -51498,19 +51524,29 @@ Roo.apply(Roo.XComponent, { return progressRun(); // we do not update the display! } - if (!m.parent) { + if (!m.parent || (typeof(m.parent) == 'string' && m.parent[0] == '#')) { // it's a top level one.. - var layoutbase = new Ext.BorderLayout(document.body, { - - center: { - titlebar: false, - autoScroll:false, - closeOnTab: true, - tabPosition: 'top', - //resizeTabs: true, - alwaysShowTabs: true, - minTabWidth: 140 - } + var ctr = m.parent ? Roo.get(m.parent.substr(1)) : document.body; + if (!ctr) { + Roo.log("not rendering module " + m.name + " " + m.parent + " no found"); + return progressRun.defer(10, _this); + + } + + + var layoutbase = new Ext.BorderLayout( + m.parent ? Roo.get(m.parent.substr(1)) : document.body, + { + center: { + titlebar: false, + autoScroll:false, + closeOnTab: true, + tabPosition: 'top', + //resizeTabs: true, + alwaysShowTabs: m.parent ? false : true, + hideTabs : m.parent ? true : false, + minTabWidth: 140 + } }); var tree = m.tree(); tree.region = 'center'; @@ -51526,8 +51562,8 @@ Roo.apply(Roo.XComponent, { m.fireEvent('built', m); m.panel = m.el; m.layout = m.panel.layout; - progressRun.defer(10, _this); - + return progressRun.defer(10, _this); + } progressRun.defer(1, _this); diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index d4485e7f48..574e69da8e 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -28225,7 +28225,7 @@ Roo.extend(Roo.form.DisplayField, Roo.form.TextField, { //if(this.inputValue !== undefined){ this.wrap = this.el.wrap(); - this.viewEl = this.wrap.createChild({ tag: 'div'}); + this.viewEl = this.wrap.createChild({ tag: 'div', cls: 'x-form-displayfield'}); if (this.bodyStyle) { this.viewEl.applyStyles(this.bodyStyle); @@ -36754,6 +36754,11 @@ Roo.XTemplate.from = function(el){ } ] *}) + * + * Roo.onReady(function() { + Roo.XComponent.build(); + }) + * * @extends Roo.util.Observable * @constructor * @param cfg {Object} configuration of component @@ -36835,8 +36840,6 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, { */ items : false - - }); Roo.apply(Roo.XComponent, { @@ -36859,12 +36862,18 @@ Roo.apply(Roo.XComponent, { /** * @property modules * array of modules to be created by registration system. - * @type Roo.XComponent + * @type {Array} of Roo.XComponent */ modules : [], + /** + * @property elmodules + * array of modules to be created by which use #ID + * @type {Array} of Roo.XComponent + */ + elmodules : [], /** * Register components to be built later. * @@ -36892,6 +36901,7 @@ Roo.apply(Roo.XComponent, { }, /** * convert a string to an object.. + * eg. 'AAA.BBB' -> finds AAA.BBB * */ @@ -36900,12 +36910,18 @@ Roo.apply(Roo.XComponent, { if (!str || typeof(str) == 'object') { return str; } + if (str[0]=='#') { + return str; + } var ar = str.split('.'); var rt, o; rt = ar.shift(); /** eval:var:o */ eval('if (typeof ' + rt + ' == "undefined"){ o = false;} o = ' + rt + ';'); if (o === false) { + + + throw "Module not found : " + str; } Roo.each(ar, function(e) { @@ -36934,6 +36950,10 @@ Roo.apply(Roo.XComponent, { this.topModule = obj; return; } + if (typeof(obj.parent) == 'string') { + this.elmodules.push(obj); + return; + } if (!obj.parent.modules) { obj.parent.modules = new Roo.util.MixedCollection(false, @@ -36957,12 +36977,13 @@ Roo.apply(Roo.XComponent, { return String(a).toUpperCase() > String(b).toUpperCase() ? 1 : -1; }; - if (!this.topModule || !this.topModule.modules) { + if ((!this.topModule || !this.topModule.modules) && !this.elmodules.length) { throw "No top level modules to build"; } - + // make a flat list in order of modules to build. - var mods = [ this.topModule ]; + var mods = this.topModule ? [ this.topModule ] : []; + Roo.each(this.elmodules,function(e) { mods.push(e) }); // add modules to their parents.. @@ -36981,8 +37002,10 @@ Roo.apply(Roo.XComponent, { } } - this.topModule.modules.keySort('ASC', cmp ); - this.topModule.modules.each(addMod); + if (this.topModule) { + this.topModule.modules.keySort('ASC', cmp ); + this.topModule.modules.each(addMod); + } return mods; }, @@ -37026,8 +37049,11 @@ Roo.apply(Roo.XComponent, { if (!mods.length) { Roo.debug && Roo.log('hide?'); Roo.MessageBox.hide(); - _this.topModule.fireEvent('buildcomplete', _this.topModule); - return; + if (_this.topModule) { + _this.topModule.fireEvent('buildcomplete', _this.topModule); + } + // THE END... + return false; } var m = mods.shift(); @@ -37053,19 +37079,29 @@ Roo.apply(Roo.XComponent, { return progressRun(); // we do not update the display! } - if (!m.parent) { + if (!m.parent || (typeof(m.parent) == 'string' && m.parent[0] == '#')) { // it's a top level one.. - var layoutbase = new Ext.BorderLayout(document.body, { - - center: { - titlebar: false, - autoScroll:false, - closeOnTab: true, - tabPosition: 'top', - //resizeTabs: true, - alwaysShowTabs: true, - minTabWidth: 140 - } + var ctr = m.parent ? Roo.get(m.parent.substr(1)) : document.body; + if (!ctr) { + Roo.log("not rendering module " + m.name + " " + m.parent + " no found"); + return progressRun.defer(10, _this); + + } + + + var layoutbase = new Ext.BorderLayout( + m.parent ? Roo.get(m.parent.substr(1)) : document.body, + { + center: { + titlebar: false, + autoScroll:false, + closeOnTab: true, + tabPosition: 'top', + //resizeTabs: true, + alwaysShowTabs: m.parent ? false : true, + hideTabs : m.parent ? true : false, + minTabWidth: 140 + } }); var tree = m.tree(); tree.region = 'center'; @@ -37081,8 +37117,8 @@ Roo.apply(Roo.XComponent, { m.fireEvent('built', m); m.panel = m.el; m.layout = m.panel.layout; - progressRun.defer(10, _this); - + return progressRun.defer(10, _this); + } progressRun.defer(1, _this); diff --git a/roojs-ui.js b/roojs-ui.js index 2f61af5896..0d63566661 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -530,7 +530,7 @@ Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(th this.grid=new Roo.grid[this.xgrid.xtype](this.viewEl,this.xgrid);this.grid.render();this.grid.getDataSource().on('remove',this.refreshValue,this);this.grid.getDataSource().on('update',this.refreshValue,this);this.grid.on('afteredit',this.refreshValue,this);},setValue:function(v){v=v||[];if(this.grid&&this.grid.getDataSource()&&typeof(v)!='undefined'){var ds=this.grid.getDataSource();var A={} A[ds.reader.meta.root]=typeof(v)=='string'?Roo.decode(v):v;ds.loadData(A);} Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var A=[];this.grid.getDataSource().each(function(r){A.push(r.data);});this.el.dom.value=Roo.encode(A);}}); -Roo.form.DisplayField=function(A){Roo.form.DisplayField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DisplayField,Roo.form.TextField,{inputType:'hidden',allowBlank:true,readOnly:true,focusClass:undefined,fieldClass:'x-form-field',valueRenderer:undefined,width:100,onResize:function(){Roo.form.DisplayField.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.DisplayField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap();this.viewEl=this.wrap.createChild({tag:'div'});if(this.bodyStyle){this.viewEl.applyStyles(this.bodyStyle);} +Roo.form.DisplayField=function(A){Roo.form.DisplayField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DisplayField,Roo.form.TextField,{inputType:'hidden',allowBlank:true,readOnly:true,focusClass:undefined,fieldClass:'x-form-field',valueRenderer:undefined,width:100,onResize:function(){Roo.form.DisplayField.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.DisplayField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap();this.viewEl=this.wrap.createChild({tag:'div',cls:'x-form-displayfield'});if(this.bodyStyle){this.viewEl.applyStyles(this.bodyStyle);} this.setValue(this.value);},onClick:function(){},setValue:function(v){this.value=v;var A=this.valueRenderer?this.valueRenderer(v):String.format('{0}',v);if(!this.viewEl){return;} this.viewEl.dom.innerHTML=A;Roo.form.DisplayField.superclass.setValue.call(this,v);}}); Roo.form.DayPicker=function(A){Roo.form.DayPicker.superclass.constructor.call(this,A);};Roo.extend(Roo.form.DayPicker,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},actionMode:'viewEl',inputType:'hidden',inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-daypick-item '});var r1='';var r2='';for(var i=0;i<7;i++){r1+='';r2+='';}var B=this.wrap.createChild(r1+''+r2+'
'+Date.dayNames[i].substring(0,3)+'
');B.select('img').on('click',this.onClick,this);this.viewEl=B;this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);},initValue:Roo.emptyFn,getValue:function(){return this.el.dom.value;},onClick:function(e){Roo.get(e.target).toggleClass('x-menu-item-checked');this.refreshValue();},refreshValue:function(){var A='';this.viewEl.select('img',true).each(function(e,i,n){A+=e.is(".x-menu-item-checked")?String(n):'';});this.setValue(A,true);},setValue:function(v,A){if(!this.el.dom){return;}var B=this.el.dom.value;this.el.dom.value=v;if(A){return;} @@ -709,12 +709,11 @@ Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,argumen D.push({id:id,target:G,exec:F,test:fn,body:m[1]||''});s=s.replace(m[0],'{xtpl'+id+'}');++id;}for(var i=D.length-1;i>=0;--i){this.compileTpl(D[i]);} this.master=D[D.length-1];this.tpls=D;};Roo.extend(Roo.XTemplate,Roo.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applySubTemplate:function(id,A,B){var t=this.tpls[id];if(t.test&&!t.test.call(this,A,B)){return '';}if(t.exec&&t.exec.call(this,A,B)){return '';}var vs=t.target?t.target.call(this,A,B):A;B=t.target?A:B;if(t.target&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;iString(b).toUpperCase()?1:-1;};if(!this.topModule||!this.topModule.modules){throw "No top level modules to build";}var C=[this.topModule];var D=function(m){C.push(m);if(m.modules){m.modules.keySort('ASC',B);m.modules.each(D);}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}} -this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);return C;},build:function(){this.preBuild();var A=this.buildOrder();if(!A.length){throw "NO modules!!!";} -Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:"Building Interface...",width:450,progress:true,closable:false,modal:false});var B=A.length;var C=this;var D=function(){if(!A.length){Roo.debug&&Roo.log('hide?');Roo.MessageBox.hide();C.topModule.fireEvent('buildcomplete',C.topModule);return;}var m=A.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return D.defer(10,C);}Roo.MessageBox.updateProgress((B-A.length)/B,"Building Interface "+(B-A.length)+" of "+B+(m.name?(' - '+m.name):''));var E=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(E){return D();}if(!m.parent){var F=new Ext.BorderLayout(document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,minTabWidth:140}});var G=m.tree();G.region='center';m.el=F.addxtype(G);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);}var G=m.tree();G.region=G.region||m.region;m.el=m.parent.el.addxtype(G);m.fireEvent('built',m);m.panel=m.el;m.layout=m.panel.layout;D.defer(10,C);} +o=o[e];});return o;},preBuild:function(){Roo.each(this.modules,function(A){A.parent=this.toObject(A.parent);if(!A.parent){this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});} +A.parent.modules.add(A);},this);},buildOrder:function(){var A=this;var B=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;};if((!this.topModule||!this.topModule.modules)&&!this.elmodules.length){throw "No top level modules to build";}var C=this.topModule?[this.topModule]:[];Roo.each(this.elmodules,function(e){C.push(e)});var D=function(m){C.push(m);if(m.modules){m.modules.keySort('ASC',B);m.modules.each(D);}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}};if(this.topModule){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);}return C;},build:function(){this.preBuild();var A=this.buildOrder();if(!A.length){throw "NO modules!!!";} +Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:"Building Interface...",width:450,progress:true,closable:false,modal:false});var B=A.length;var C=this;var D=function(){if(!A.length){Roo.debug&&Roo.log('hide?');Roo.MessageBox.hide();if(C.topModule){C.topModule.fireEvent('buildcomplete',C.topModule);}return false;}var m=A.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return D.defer(10,C);}Roo.MessageBox.updateProgress((B-A.length)/B,"Building Interface "+(B-A.length)+" of "+B+(m.name?(' - '+m.name):''));var E=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(E){return D();}if(!m.parent||(typeof(m.parent)=='string'&&m.parent[0]=='#')){var F=m.parent?Roo.get(m.parent.substr(1)):document.body;if(!F){Roo.log("not rendering module "+m.name+" "+m.parent+" no found");return D.defer(10,C);}var G=new Ext.BorderLayout(m.parent?Roo.get(m.parent.substr(1)):document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:m.parent?false:true,hideTabs:m.parent?true:false,minTabWidth:140}});var H=m.tree();H.region='center';m.el=G.addxtype(H);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);}var H=m.tree();H.region=H.region||m.region;m.el=m.parent.el.addxtype(H);m.fireEvent('built',m);m.panel=m.el;m.layout=m.panel.layout;return D.defer(10,C);} D.defer(1,C);}}); Roo.Login=function(A){this.addEvents({'refreshed':true});Roo.apply(this,A);Roo.onReady(function(){this.onLoad();},this);Roo.Login.superclass.constructor.call(this,this);} Roo.extend(Roo.Login,Roo.LayoutDialog,{method:'POST',url:'',user:false,checkFails:0,intervalID:0,onLoad:function(){if(Roo.get('loading')){Roo.get('loading').remove();}