sync
[Pman.Admin] / Pman.Dialog.AdminEnumImages.js
index 4a72f98..9ac979c 100644 (file)
@@ -168,17 +168,18 @@ Pman.Dialog.AdminEnumImages = {
            click : function()
             {
                 var s = _this.grid.getSelectionModel().getSelections();
            click : function()
             {
                 var s = _this.grid.getSelectionModel().getSelections();
+                
                 if (!s || s.length != 1) {
                     Roo.MessageBox.alert("Error", "Select a single image to edit");
                    return;
                  }
                  var data = _this.grid.getDataSource().getById(s[0].data.id).data;
                 if (!s || s.length != 1) {
                     Roo.MessageBox.alert("Error", "Select a single image to edit");
                    return;
                  }
                  var data = _this.grid.getDataSource().getById(s[0].data.id).data;
-                
-                         Pman.Dialog.Image.show(data, function() {
-                            _this.grid.footer.onClick('first');
-                           });
+                 
+                 Pman.Dialog.Image.show(data, function() {
+                    _this.grid.footer.onClick('first');
+                   });
                         
                         
-                    }
+            }
           },
           xns : Roo,
           '|xns' : 'Roo'
           },
           xns : Roo,
           '|xns' : 'Roo'
@@ -192,16 +193,16 @@ Pman.Dialog.AdminEnumImages = {
            click : function()
             {
                 var ids = [];
            click : function()
             {
                 var ids = [];
-                _this.grid.dataSource.each(function(rr) {
-                    if (rr.selected) {
-                        ids.push(rr.data.id);
-                    }
-                });   
-                if (!ids.length) {
-                    Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
+                
+                var sc = _this.grid.getSelectionModel().getSelections();
+                
+                if (!sc.length) {
+                    Roo.MessageBox.alert("Error", "Select rows by clicking the row");
                     return;
                 }
                     return;
                 }
-                
+                Roo.each(sc, function(v){
+                    ids.push(v.id);
+                });
                 Roo.MessageBox.confirm(
                     "Confirm", 
                     "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere", 
                 Roo.MessageBox.confirm(
                     "Confirm", 
                     "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere", 
@@ -211,7 +212,7 @@ Pman.Dialog.AdminEnumImages = {
                         }
                         new Pman.Request({
                             method : 'POST',
                         }
                         new Pman.Request({
                             method : 'POST',
-                            url : baseURL + '/Roo/Core_enum',
+                            url : baseURL + '/Roo/Images',
                             params : {
                                 _delete  : ids.join(',')
                             },
                             params : {
                                 _delete  : ids.join(',')
                             },