Pman.Dialog.AdminCoreEnum.bjs
[Pman.Admin] / Pman.Dialog.AdminCoreEnum.js
index cb1bd9a..6033470 100644 (file)
@@ -30,6 +30,20 @@ Pman.Dialog.AdminCoreEnum = {
         this.dialog = Roo.factory({
             xtype: 'LayoutDialog',
             xns: Roo,
+            listeners : {
+                show : function (_self)
+                {
+                    var name_hidden = false;
+                
+                    if (typeof(_this.data._hide_name) != 'undefined') {
+                        name_hidden = true;
+                    
+                    }
+                    
+                  _this.grid.colModel.setHidden(1,name_hidden);
+                    _this.grid.footer.onClick('first');
+                }
+            },
             height : 400,
             title : "Pulldown Options",
             width : 950,
@@ -98,10 +112,8 @@ Pman.Dialog.AdminCoreEnum = {
                             listeners : {
                                 beforeload : function (_self, options)
                                 {
-                                    if (!_this.etypeCombo) {
-                                        return false;
-                                    }
-                                    options.params.etype = _this.etypeCombo.getValue();
+                                
+                                    options.params.etype = _this.data.etype;
                                     if (!options.params.etype.length) {
                                         return false;
                                     }
@@ -111,13 +123,18 @@ Pman.Dialog.AdminCoreEnum = {
                                     if (operation != Roo.data.Record.COMMIT) {
                                         return;
                                     }
+                                    
+                                    var name = record.data.name;
+                                    if (typeof(_this.data._hide_name) != 'undefined') {
+                                        name =  record.data.display_name;
+                                    }
                                     // got commit..
                                     new Pman.Request({
                                         url : baseURL + '/Roo/Core_enum.php',
                                         method : 'POST',
                                         params : {
                                             id : record.data.id,
-                                            etype : _this.etypeCombo.getValue(),
+                                            etype : _this.data.etype,
                                             name : record.data.name,
                                             active : record.data.active,
                                             seqid : record.data.seqid,
@@ -319,6 +336,21 @@ Pman.Dialog.AdminCoreEnum = {
                 {
                     xtype: 'Button',
                     xns: Roo,
+                    listeners : {
+                        click : function (_self, e)
+                        {
+                            var sel = _this.grid.selModel.getSelectedCell();
+                            if (!sel) {
+                                Roo.MesssageBox.alert("Error", "Select an item");
+                                return;
+                            }
+                            var rec = _this.grid.getAt(sel[0]);
+                            if (_this.callback) {
+                               _this.callback(rec.data);
+                           }
+                           _this.dialog.hide();
+                        }
+                    },
                     text : "OK"
                 }
             ]