Pman.Tab.AdminEnum.bjs
authorbenny <benny@roojs.com>
Tue, 17 Jul 2018 08:18:52 +0000 (16:18 +0800)
committerbenny <benny@roojs.com>
Tue, 17 Jul 2018 08:18:52 +0000 (16:18 +0800)
Pman.Tab.AdminEnum.js

Pman.Tab.AdminEnum.bjs
Pman.Tab.AdminEnum.js

index 204c1c9..e3083c8 100644 (file)
             },
             {
              "listeners" : {
-              "|click" : "function()\n{\n    var s = [];\n    s.push(_this.grid.selModel.selection.record.id);\n    \n    if (s.length * 1 < 1)  {\n        Roo.MessageBox.alert(\"Error\", \"Select a Row\");\n        return;\n    }\n    console.log(_this.grid.selModel.selection.record);\n    var select_index = _this.grid.selModel.selection.record;\n    \n    var d = _this.grid.ds.data(s[select_index]);\n    \n    Pman.Dialog.AdminEnumMerge.show(d.data, function() {\n        _this.grid.footer.onClick('refresh');\n    }); \n    \n}\n"
+              "|click" : "function()\n{\n    \n    var s = _this.grid.getSelectionModel().getSelections();\n    \n    if (!s.length)  {\n        Roo.MessageBox.alert(\"Error\", \"Select a Row\");\n        return;\n    }\n    \n    var d = _this.grid.ds.getAt(s[0]);\n\n    Pman.Dialog.AdminEnumMerge.show(d.data, function() {\n        _this.grid.footer.onClick('refresh');\n    }); \n    \n}\n"
              },
              "text" : "Merge Option",
              "xtype" : "Button",
index cbfafa4..116a9d7 100644 (file)
@@ -647,18 +647,16 @@ Pman.Tab.AdminEnum = new Roo.XComponent({
           listeners : {
            click : function()
             {
-                var s = [];
-                s.push(_this.grid.selModel.selection.record.id);
                 
-                if (s.length * 1 < 1)  {
+                var s = _this.grid.getSelectionModel().getSelections();
+                
+                if (!s.length)  {
                     Roo.MessageBox.alert("Error", "Select a Row");
                     return;
                 }
-                console.log(_this.grid.selModel.selection.record);
-                var select_index = _this.grid.selModel.selection.record;
-                
-                var d = _this.grid.ds.data(s[select_index]);
                 
+                var d = _this.grid.ds.getAt(s[0]);
+            
                 Pman.Dialog.AdminEnumMerge.show(d.data, function() {
                     _this.grid.footer.onClick('refresh');
                 });