Pman.Dialog.AdminCoreEnum.bjs
[Pman.Admin] / Pman.Dialog.AdminCoreEnum.js
index 4ad8651..1b3446d 100644 (file)
@@ -30,7 +30,24 @@ 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');
+                }
+            },
+            closable : false,
             height : 400,
+            modal : true,
+            resizable : false,
             title : "Pulldown Options",
             width : 950,
             items : [
@@ -109,6 +126,11 @@ 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',
@@ -317,6 +339,23 @@ Pman.Dialog.AdminCoreEnum = {
                 {
                     xtype: 'Button',
                     xns: Roo,
+                    listeners : {
+                        click : function (_self, e)
+                        {
+                            var sel = _this.grid.selModel.getSelectedCell();
+                            if (!sel && _this.callback) {
+                                Roo.MessageBox.alert("Error", "Select an item");
+                                return;
+                            }
+                            
+                        
+                            if (_this.callback) {
+                                var rec = _this.grid.ds.getAt(sel[0]);
+                               _this.callback(rec.data);
+                           }
+                           _this.dialog.hide();
+                        }
+                    },
                     text : "OK"
                 }
             ]