From 2b38d76273a39de127ee784849ae1f041b7b85c9 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 17 Feb 2015 16:18:05 +0800 Subject: [PATCH] Pman.Dialog.BuilderAdd.bjs Pman.Dialog.BuilderAdd.js --- Pman.Dialog.BuilderAdd.bjs | 12 +- Pman.Dialog.BuilderAdd.js | 280 ++++++++++++++++++------------------- 2 files changed, 146 insertions(+), 146 deletions(-) diff --git a/Pman.Dialog.BuilderAdd.bjs b/Pman.Dialog.BuilderAdd.bjs index 258fc63..82462c9 100644 --- a/Pman.Dialog.BuilderAdd.bjs +++ b/Pman.Dialog.BuilderAdd.bjs @@ -8,8 +8,8 @@ "items" : [ { "modal" : true, - "xtype" : "LayoutDialog", "title" : "Add Node", + "xtype" : "LayoutDialog", "width" : 400, "$ xns" : "Roo", "closable" : false, @@ -23,16 +23,16 @@ "items" : [ { "listeners" : { - "rendered" : "function (form)\n{\n _this.form = form;\n}", - "actioncomplete" : "function (_self, action)\n{\n if (action.type == 'setdata') {\n // check if element can be templated or databased..\n \n \n }\n}" + "actioncomplete" : "function (_self, action)\n{\n if (action.type == 'setdata') {\n // check if element can be templated or databased..\n \n \n }\n}", + "rendered" : "function (form)\n{\n _this.form = form;\n}" }, "xtype" : "Form", "$ xns" : "Roo.form", "items" : [ { - "legend" : "Do you want to create the element?", - "xtype" : "FieldSet", "style" : "width:350px", + "legend" : "Do you want to create the element ?", + "xtype" : "FieldSet", "labelWidth" : 140, "$ xns" : "Roo.form", "items" : [ @@ -68,8 +68,8 @@ "items" : [ { "$ url" : "baseURL + '/Builder/ERM.php'", - "method" : "GET", "xtype" : "HttpProxy", + "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, diff --git a/Pman.Dialog.BuilderAdd.js b/Pman.Dialog.BuilderAdd.js index 5aab5b9..1a4ffe7 100644 --- a/Pman.Dialog.BuilderAdd.js +++ b/Pman.Dialog.BuilderAdd.js @@ -30,169 +30,169 @@ Pman.Dialog.BuilderAdd = { { var _this = this; this.dialog = Roo.factory({ - center : { + center : { + '|xns' : 'Roo', + xtype : 'LayoutRegion', + xns : Roo + }, '|xns' : 'Roo', - xtype : 'LayoutRegion', - xns : Roo - }, - '|xns' : 'Roo', - modal : true, - xtype : 'LayoutDialog', - title : "Add Node", - width : 400, - xns : Roo, - closable : false, - resizable : false, - height : 170, - buttons : [ - { - '|xns' : 'Roo', - text : "OK", - xtype : 'Button', - xns : Roo, - listeners : { - click : function (_self, e) - { - var vals = _this.form.getValues(); + modal : true, + title : "Add Node", + xtype : 'LayoutDialog', + width : 400, + xns : Roo, + closable : false, + resizable : false, + height : 170, + buttons : [ + { + '|xns' : 'Roo', + text : "OK", + xtype : 'Button', + xns : Roo, + listeners : { + click : function (_self, e) + { + var vals = _this.form.getValues(); + + _this.dialog.hide(); + + if (vals.table.length) { + Pman.Dialog.BuilderAddTable.show( + Roo.apply({ table : vals.table } , _this.data), + + function(data) { + _this.dialog.hide(); + var cls = data['|xns'] + '.' + data['xtype']; + + var res = Pman.Builder.Wizard[cls](data); + _this.callback(res); + }); + return; + } - _this.dialog.hide(); + // otherwise, call back with template?? - if (vals.table.length) { - Pman.Dialog.BuilderAddTable.show( - Roo.apply({ table : vals.table } , _this.data), - - function(data) { - _this.dialog.hide(); - var cls = data['|xns'] + '.' + data['xtype']; - - var res = Pman.Builder.Wizard[cls](data); - _this.callback(res); - }); - return; - } - - // otherwise, call back with template?? - - - _this.callback(_this.data); - } - } - }, + + _this.callback(_this.data); + } + } + }, { - '|xns' : 'Roo', - text : "Cancel", - xtype : 'Button', - xns : Roo, - listeners : { - click : function (_self, e) - { - _this.dialog.hide(); - } - } - } - ], - items : [ - { - '|xns' : 'Roo', - region : 'center', - xtype : 'ContentPanel', - xns : Roo, - items : [ - { - '|xns' : 'Roo.form', - xtype : 'Form', - xns : Roo.form, + '|xns' : 'Roo', + text : "Cancel", + xtype : 'Button', + xns : Roo, listeners : { - rendered : function (form) - { - _this.form = form; - }, - actioncomplete : function (_self, action) + click : function (_self, e) { - if (action.type == 'setdata') { - // check if element can be templated or databased.. - - - } + _this.dialog.hide(); } - }, - items : [ - { - '|xns' : 'Roo.form', - legend : "Do you want to create the element?", - xtype : 'FieldSet', - style : 'width:350px', - labelWidth : 140, - xns : Roo.form, - items : [ + } + } + ], + items : [ + { + '|xns' : 'Roo', + region : 'center', + xtype : 'ContentPanel', + xns : Roo, + items : [ + { + '|xns' : 'Roo.form', + xtype : 'Form', + xns : Roo.form, + listeners : { + actioncomplete : function (_self, action) { - store : { - '|xns' : 'Roo.data', - xtype : 'Store', - xns : Roo.data - }, - '|xns' : 'Roo.form', - fieldLabel : 'From Template', - xtype : 'ComboBox', - xns : Roo.form, - name : 'template', - items : [ - - ] - + if (action.type == 'setdata') { + // check if element can be templated or databased.. + + + } }, + rendered : function (form) { - store : { - proxy : { + _this.form = form; + } + }, + items : [ + { + '|xns' : 'Roo.form', + style : 'width:350px', + legend : "Do you want to create the element ?", + xtype : 'FieldSet', + labelWidth : 140, + xns : Roo.form, + items : [ + { + store : { '|xns' : 'Roo.data', - url : baseURL + '/Builder/ERM.php', - method : 'GET', - xtype : 'HttpProxy', + xtype : 'Store', xns : Roo.data }, - reader : { + '|xns' : 'Roo.form', + fieldLabel : 'From Template', + xtype : 'ComboBox', + xns : Roo.form, + name : 'template', + items : [ + + ] + + }, + { + store : { + proxy : { + '|xns' : 'Roo.data', + url : baseURL + '/Builder/ERM.php', + xtype : 'HttpProxy', + method : 'GET', + xns : Roo.data + }, + reader : { + '|xns' : 'Roo.data', + root : 'data', + xtype : 'JsonReader', + fields : [ 'name' , 'desc' ], + xns : Roo.data, + totalProperty : 'total' + }, '|xns' : 'Roo.data', - root : 'data', - xtype : 'JsonReader', - fields : [ 'name' , 'desc' ], + xtype : 'Store', xns : Roo.data, - totalProperty : 'total' + items : [ + + ] + }, - '|xns' : 'Roo.data', - xtype : 'Store', - xns : Roo.data, + '|xns' : 'Roo.form', + alwaysQuery : true, + listWidth : 400, + triggerAction : 'all', + fieldLabel : 'From Database Table', + displayField : 'name', + xtype : 'ComboBox', + allowBlank : true, + xns : Roo.form, + name : 'table', + tpl : '
{name} {desc}
', items : [ ] - }, - '|xns' : 'Roo.form', - alwaysQuery : true, - listWidth : 400, - triggerAction : 'all', - fieldLabel : 'From Database Table', - displayField : 'name', - xtype : 'ComboBox', - allowBlank : true, - xns : Roo.form, - name : 'table', - tpl : '
{name} {desc}
', - items : [ - - ] + } + ] - } - ] + } + ] - } - ] + } + ] - } - ] - - } - ] + } + ] - }); + }); } }; -- 2.39.2