From: edward Date: Mon, 21 Sep 2015 05:46:14 +0000 (+0800) Subject: Pman.Dialog.CoreEnum.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=98269f04479efabdf26ebe65d2bf6f98d8844e4c Pman.Dialog.CoreEnum.bjs Pman.Dialog.CoreEnum.js --- diff --git a/Pman.Dialog.CoreEnum.bjs b/Pman.Dialog.CoreEnum.bjs index 21f22299..fd0c358c 100644 --- a/Pman.Dialog.CoreEnum.bjs +++ b/Pman.Dialog.CoreEnum.bjs @@ -8,8 +8,11 @@ "strings" : { "518ad9ed87d3ca17e223a91604b464d5" : "Add / Edit Core Enum", "cfcd208495d565ef66e7dff9f98764da" : "0", + "b48968e1c912da07df5e8d6d246291ec" : "Display Name", "c4ca4238a0b923820dcc509a6f75849b" : "1", "ea4788705e6873b424c65e91c2846b19" : "Cancel", + "49ee3087348e8d44e1feda1917443987" : "Name", + "4d3d769b812b6faa6b76e1a8abaece2d" : "Active", "e0aa021e21dddbd6d8cecec71e9cf564" : "OK" }, "items" : [ @@ -35,9 +38,9 @@ "* prop" : "center" }, { + "region" : "center", "fitToFrame" : true, "background" : true, - "region" : "center", "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ @@ -47,8 +50,8 @@ "|rendered" : "function (form)\n{\n _this.form = form;\n}" }, "$ url" : "baseURL + '/Roo/core_enum.php'", - "xtype" : "Form", "method" : "POST", + "xtype" : "Form", "style" : "margin: 5px", "$ xns" : "Roo.form", "items" : [ diff --git a/Pman.Dialog.CoreEnum.js b/Pman.Dialog.CoreEnum.js index a3a6751a..c917c4e3 100644 --- a/Pman.Dialog.CoreEnum.js +++ b/Pman.Dialog.CoreEnum.js @@ -9,8 +9,11 @@ Pman.Dialog.CoreEnum = { _strings : { '518ad9ed87d3ca17e223a91604b464d5' :"Add / Edit Core Enum", 'cfcd208495d565ef66e7dff9f98764da' :"0", + 'b48968e1c912da07df5e8d6d246291ec' :"Display Name", 'c4ca4238a0b923820dcc509a6f75849b' :"1", 'ea4788705e6873b424c65e91c2846b19' :"Cancel", + '49ee3087348e8d44e1feda1917443987' :"Name", + '4d3d769b812b6faa6b76e1a8abaece2d' :"Active", 'e0aa021e21dddbd6d8cecec71e9cf564' :"OK" }, @@ -38,79 +41,79 @@ Pman.Dialog.CoreEnum = { { var _this = this; this.dialog = Roo.factory({ - center : { - '|xns' : 'Roo', - titlebar : false, - xns : Roo, - xtype : 'LayoutRegion' - }, - '|xns' : 'Roo', background : true, closable : false, collapsible : false, height : 150, modal : true, resizable : false, - title : _this._strings['518ad9ed87d3ca17e223a91604b464d5'], + title : _this._strings['518ad9ed87d3ca17e223a91604b464d5'] /* Add / Edit Core Enum */, width : 400, xns : Roo, + '|xns' : 'Roo', xtype : 'LayoutDialog', - buttons : [ - { - '|xns' : 'Roo', - text : _this._strings['ea4788705e6873b424c65e91c2846b19'], - xns : Roo, - xtype : 'Button', - listeners : { - click : function() { - _this.form.reset(); - _this.dialog.hide(); - } - } - }, -{ - '|xns' : 'Roo', - text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'], - xns : Roo, - xtype : 'Button', - listeners : { - click : function() { - - var name = _this.form.findField('name').getValue(); - name = name.toUpperCase().replace(/[^A-Z]+/g, ''); - if (!name.length) { - Roo.MessageBox.alert("Error","Please fill in a valid name"); - return; - } - _this.form.findField('name').setValue(name); - - _this.form.doAction('submit'); - - } - } - } - ], listeners : { show : function (_self) { } }, - items : [ + center : { + titlebar : false, + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + buttons : [ + { + text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'Button', + listeners : { + click : function() { + _this.form.reset(); + _this.dialog.hide(); + } + } + }, { + text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */, + xns : Roo, '|xns' : 'Roo', + xtype : 'Button', + listeners : { + click : function() { + + var name = _this.form.findField('name').getValue(); + name = name.toUpperCase().replace(/[^A-Z]+/g, ''); + if (!name.length) { + Roo.MessageBox.alert("Error","Please fill in a valid name"); + return; + } + _this.form.findField('name').setValue(name); + + _this.form.doAction('submit'); + + } + } + } + ], + items : [ + { background : true, fitToFrame : true, region : 'center', xns : Roo, + '|xns' : 'Roo', xtype : 'ContentPanel', - items : [ + items : [ { - '|xns' : 'Roo.form', method : 'POST', style : 'margin: 5px', url : baseURL + '/Roo/core_enum.php', xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'Form', listeners : { actioncomplete : function (_self, action) @@ -153,25 +156,25 @@ Pman.Dialog.CoreEnum = { _this.form = form; } }, - items : [ + items : [ { - '|xns' : 'Roo.form', actionMode : 'fieldEl', allowBlank : false, - fieldLabel : 'Name', + fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, hidden : true, name : 'name', width : 200, xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'TextField' }, { - '|xns' : 'Roo.form', allowBlank : false, - fieldLabel : 'Display Name', + fieldLabel : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */, name : 'display_name', width : 200, xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'TextField', listeners : { keyup : function (_self, e) @@ -182,45 +185,42 @@ Pman.Dialog.CoreEnum = { } }, { - '|xns' : 'Roo.form', actionMode : 'fieldEl', checked : true, - fieldLabel : 'Active', + fieldLabel : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */, hidden : true, inputValue : 1, name : 'active', value : 1, valueOff : 0, xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'Checkbox' }, { - '|xns' : 'Roo.form', name : 'etype', xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'Hidden' }, { - '|xns' : 'Roo.form', name : 'seqid', value : 0, xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'Hidden' }, { - '|xns' : 'Roo.form', name : 'id', xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'Hidden' } ] - } ] - } ] - }); } };