1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '001-Pman.Tab.BuilderView',
12 module : Pman.Tab.BuilderView,
14 parent : Pman.Tab.BuilderTab,
15 name : "Pman.Tab.BuilderView",
21 Pman.Tab.BuilderView = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
34 xtype: 'ContentPanel',
37 activate : function (_self)
51 if (typeof(cfg.background) != 'undefined') {
52 cfg.background = false;
57 // key is not string?!?!?!!?
58 if (typeof(p) != 'string') {
62 if (typeof(cfg[p]) == 'object') { // listeners!!!
67 if (p.charAt(0) == '|') {
75 var _this = this.renderObj; /// fake '_this' object..
76 // stupid IE can not return objects evaluated..
81 eval('_tmp =(' + cfg[p] + ')');
82 cfg[p.substr(1)] = _tmp;
83 //if (typeof(_tmp) == 'undefined') {
87 } catch(e) { console.log('Error evaluating: ' + cfg[p]); };
94 if ((p.charAt(0) == '*') || (p.charAt(0) == '+')) {
101 // now for all the children.. (items)
102 if (xitems === false) {
106 for (var i = 0; i < xitems.length; i++) {
107 // if +builderhide set !!!! drop it!!
111 if (typeof(xi['*prop']) != 'undefined') {
112 var pr = xi['*prop'];
114 // if prop is an array - then it's items are really the value..
116 if (xi.xtype && xi.xtype == 'Array') {
129 if (cfg.items.length == 0) {
135 clearAll : function(isAuto) {
136 // this.renderObj = { isBuilder : true };
139 if (this.panelroot) {
140 this.scroll = this.panelroot.el.getScroll();
141 this.layout.remove('center', this.panelroot);
142 this.panelroot = false;
144 if (this.dialogroot) {
145 this.dialogroot.remove();
146 this.dialogroot = false;
149 redraw : function(isAuto)
152 // top level is not relivant
154 // var btop = Pman.Tab.BuilderTop2;
155 // if (isAuto && btop.redrawBtn && !btop.redrawBtn.auto) {
156 // return; /// auto redraw is turned off..
159 this.clearAll(isAuto);
161 var cfg = this.toJS();
167 this.munge(cfg.items[0]);
169 // we draw either a dialog or a tab..
171 if (cfg.items[0].xtype == 'LayoutDialog') {
173 cfg.items[0].modal = false;
174 var xy = this.panel.el.getXY();
175 cfg.items[0].x = xy[0];
176 cfg.items[0].y = xy[1];
177 cfg.items[0].constraintoviewport = false;
179 this.dialogroot = Roo.get( document.body).createChild();
181 this.dialog = new Roo[cfg.items[0].xtype](this.dialogroot, cfg.items[0]);
182 this.dialog.el.on('click', this.panelClick, this);
188 // force center region..
189 cfg.items[0].region = 'center';
190 cfg.items[0].background = false;
192 this.panelroot = this.layout.addxtype(cfg.items[0]);
195 //this.highlightElement(Pman.Tab.BuilderTree.currentNode);
197 if (this.panelroot.el) {
198 this.panelroot.el.scrollTo('top', this.scroll.top);
199 this.panelroot.el.scrollTo('left', this.scroll.left);
204 var bt = Pman.Tab.BuilderTree;
206 return this.toJS(bt.tree.root);
210 var ret = bt.cloneConfig(n.elConfig);
212 // flag to prevent rendering..
213 if ((typeof(ret['+buildershow']) != 'undefined') && !ret['+buildershow']) {
217 ret.id = typeof(ret.id) == 'undefined' ? 'builder-' + n.id : ret.id;
219 if (n.childNodes.length) {
221 n.eachChild(function(cn) {
222 var add = _this.toJS(cn);
235 this.layout = this.panel.layout;