X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.CoreEnum.js;h=273763aba5b58f579c06a8e44023496423b950ee;hp=91a3333dd411bcd6071ccd97752b5d8bf14e269d;hb=443623f47935eb52acd65a3ff0d84eab1fd5a98b;hpb=334fc63d55f88d291afa6c83e92b4ad9553f814a diff --git a/Pman.Dialog.CoreEnum.js b/Pman.Dialog.CoreEnum.js index 91a3333d..273763ab 100644 --- a/Pman.Dialog.CoreEnum.js +++ b/Pman.Dialog.CoreEnum.js @@ -9,9 +9,20 @@ Pman.Dialog.CoreEnum = { _strings : { '518ad9ed87d3ca17e223a91604b464d5' :"Add / Edit Core Enum", 'cfcd208495d565ef66e7dff9f98764da' :"0", + 'b48968e1c912da07df5e8d6d246291ec' :"Display Name", + 'c4ca4238a0b923820dcc509a6f75849b' :"1", 'ea4788705e6873b424c65e91c2846b19' :"Cancel", + '49ee3087348e8d44e1feda1917443987' :"Name", + '4d3d769b812b6faa6b76e1a8abaece2d' :"Active", 'e0aa021e21dddbd6d8cecec71e9cf564' :"OK" }, + _named_strings : { + 'display_name_fieldLabel' : 'b48968e1c912da07df5e8d6d246291ec' /* Display Name */ , + 'seqid_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ , + 'name_fieldLabel' : '49ee3087348e8d44e1feda1917443987' /* Name */ , + 'active_fieldLabel' : '4d3d769b812b6faa6b76e1a8abaece2d' /* Active */ , + 'active_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ + }, dialog : false, callback: false, @@ -37,80 +48,78 @@ Pman.Dialog.CoreEnum = { { var _this = this; this.dialog = Roo.factory({ - center : { - '|xns' : 'Roo', - titlebar : false, - xns : Roo, - xtype : 'LayoutRegion' - }, - '|xns' : 'Roo', + xtype : 'LayoutDialog', 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, - 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 : [ + xns : Roo, + '|xns' : 'Roo', + center : { + xtype : 'LayoutRegion', + titlebar : false, + xns : Roo, + '|xns' : 'Roo' + }, + buttons : [ { - '|xns' : 'Roo', + xtype : 'Button', + text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */, + listeners : { + click : function() { + _this.form.reset(); + _this.dialog.hide(); + } + }, + xns : Roo, + '|xns' : 'Roo' + }, + { + xtype : 'Button', + text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */, + 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'); + + } + }, + xns : Roo, + '|xns' : 'Roo' + } + ], + items : [ + { + xtype : 'ContentPanel', background : true, fitToFrame : true, region : 'center', xns : Roo, - xtype : 'ContentPanel', - items : [ + '|xns' : 'Roo', + items : [ { - '|xns' : 'Roo.form', + xtype : 'Form', method : 'POST', style : 'margin: 5px', url : baseURL + '/Roo/core_enum.php', - xns : Roo.form, - xtype : 'Form', listeners : { actioncomplete : function (_self, action) { @@ -121,6 +130,10 @@ Pman.Dialog.CoreEnum = { _this.dialog.hide(); return; } + + if(typeof(_this.data.title) != 'undefined' && _this.data.title.length){ + _this.dialog.setTitle(_this.data.title); + } if(_this.data.id){ _this.dialog.el.mask("Loading"); @@ -148,72 +161,73 @@ Pman.Dialog.CoreEnum = { _this.form = form; } }, - items : [ + xns : Roo.form, + '|xns' : 'Roo.form', + items : [ { - '|xns' : 'Roo.form', + xtype : 'TextField', actionMode : 'fieldEl', allowBlank : false, - fieldLabel : 'Name', + fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, hidden : true, name : 'name', width : 200, xns : Roo.form, - xtype : 'TextField' + '|xns' : 'Roo.form' }, { - '|xns' : 'Roo.form', + xtype : 'TextField', allowBlank : false, - fieldLabel : 'Display Name', + fieldLabel : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */, name : 'display_name', - width : 200, - xns : Roo.form, - xtype : 'TextField', + width : 250, listeners : { keyup : function (_self, e) { _this.form.findField('name').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase()); } - } + }, + xns : Roo.form, + '|xns' : 'Roo.form' }, { - '|xns' : 'Roo.form', + xtype : 'Checkbox', actionMode : 'fieldEl', - fieldLabel : 'Active', + checked : true, + fieldLabel : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */, + hidden : true, inputValue : 1, name : 'active', - value : 0, + value : 1, valueOff : 0, xns : Roo.form, - xtype : 'Checkbox' + '|xns' : 'Roo.form' }, { - '|xns' : 'Roo.form', + xtype : 'Hidden', name : 'etype', xns : Roo.form, - xtype : 'Hidden' + '|xns' : 'Roo.form' }, { - '|xns' : 'Roo.form', + xtype : 'Hidden', name : 'seqid', value : 0, xns : Roo.form, - xtype : 'Hidden' + '|xns' : 'Roo.form' }, { - '|xns' : 'Roo.form', + xtype : 'Hidden', name : 'id', xns : Roo.form, - xtype : 'Hidden' + '|xns' : 'Roo.form' } ] - } ] - } ] - }); } };