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.BuilderTop',
12 module : Pman.Tab.BuilderTop,
14 parent : Pman.Tab.BuilderTab,
15 name : "Pman.Tab.BuilderTop",
21 Pman.Tab.BuilderTop = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
34 xtype: 'ContentPanel',
46 text : "Manage Modules",
55 click : function (_self, e)
57 Pman.Dialog.BuilderModule.show({
61 _this.modsel.setFromData(data);
68 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
74 click : function (_self, e)
77 if (!_this.modsel.lastData || !_this.modsel.lastData.id) {
78 Roo.MessageBox.alert("Error", "Select Module");
81 Pman.Dialog.BuilderModule.show( _this.modsel.lastData ,function(data) {
83 _this.modsel.setFromData(data);
95 click : function (_self, e)
110 select : function (combo, record, index)
112 _this.filesel.reset();
113 _this.filesel.fireEvent('select', false);
116 render : function (_self)
123 displayField : 'name',
125 forceSelection : true,
127 loadingText : "Searching...",
130 queryParam : 'query[name]',
131 selectOnFocus : true,
132 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b></div>',
133 triggerAction : 'all',
141 sortInfo : { field : 'name' , direction : 'ASC' },
146 url : baseURL + '/Roo/Builder_modules.php'
153 totalProperty : 'total',
168 text : "Manage Parts ",
177 click : function (_self, e)
179 if (!_this.modsel.lastData || !_this.modsel.lastData.id) {
180 Roo.MessageBox.alert("Error", "Select Module");
184 _this.filesel.reset();
185 Pman.Tab.BuilderTree.clearAll();
186 Pman.Tab.BuilderTree.setCurrentNode(Pman.Tab.BuilderTree.tree.root,true);
188 var bp = Pman.Tab.BuilderPanel;
189 bp.redraw.defer(100,bp,[true]);
193 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
208 select : function (combo, rec, index)
210 //cb.lastData = rec.data;
215 var bt = Pman.Tab.BuilderTree.tree;
220 bt.setCurrentNode(bt.root,true);
221 // var bv = Pman.Tab.BuilderView;
222 Pman.Tab.BuilderView.panel.clearAll();
223 // bv.panel.el.mask("select Module / Part");
226 //bv.panel.el.unmask();
228 bt.loadBJS(_this.modsel.getValue(), rec.data.name)
232 render : function (_self)
234 _this.filesel = this;
239 displayField : 'name',
241 forceSelection : true,
243 loadingText : "Searching...",
246 queryParam : 'query[name]',
247 selectOnFocus : true,
248 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b></div>',
249 triggerAction : 'all',
257 beforeload : function (_self, o)
259 o.params = o.params || {};
260 // o.params.btype = 'FORM';
261 if (!_this.modsel.getValue().length) {
262 Roo.MessageBox.alert("Error", "Select Module");
265 o.params.module = _this.modsel.getValue();
270 sortInfo : { field : 'name' , direction : 'ASC' },
275 url : baseURL + '/Builder/Parts.php'
282 totalProperty : 'total',
297 click : function (_self, e)
301 render : function (_self)
303 _this.saveBtn = this;
306 cls : 'x-btn-text-icon',
309 // first see if first element has a name.. - we can not save otherwise..
310 var t = Pman.Tab.BuilderTree.tree;
311 if (!t.root.elConfig.name.length) {
312 Roo.MessageBox.alert("Error", "No name set for form");
316 sid = (typeof(sid) == 'undefined') ? (this.filesel.lastData ? this.filesel.lastData.id : 0) : sid;
318 var js = Pman.Tab.BuilderTree.toJS();
319 var json = Roo.encode(js);
321 // console.log(json);
323 // check the select box to see if that has been set... - save it with that id..
328 url: baseURL + '/Roo/Builder.php',
332 name : t.root.elConfig.name,
333 module : t.root.elConfig['|module'],
334 app : t.root.elConfig.app,
338 success : function(data) {
342 _this.filesel.setFromData(data);
346 _this.postCode(data);
351 icon : rootURL + '/Pman/templates/images/save.gif',
360 click : function (_self, e)
362 _this.saveBtn.save(false,0);
365 icon : rootURL + '/Pman/templates/images/save.gif',
366 text : "Save a copy as"
372 click : function (_self, e)
376 Pman.Dialog.BuilderViewCode.show({ id : _this.filesel.getValue() } );
392 xtype: 'SplitButton',
395 click : function (_self, e)
397 Pman.Tab.BuilderView.panel.redraw();
409 click : function (_self, e)
411 _this.redrawBtn.setText("Redraw (AUTO OFF)");
412 _this.redrawBtn.auto = 0;
416 text : "Auto redraw - OFF"
422 click : function (_self, e)
425 _this.redrawBtn.setText("Redraw");
426 _this.redrawBtn.auto = 1;
427 var bp = Pman.Tab.BuilderPanel;
428 bp.redraw.defer(100,bp,[true]);
433 text : "Auto redraw - On"
441 this.layout = this.panel.layout;