From 82f140e35286d8c785398697c60ff9b64b842381 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 13 Sep 2012 14:32:10 +0800 Subject: [PATCH] Pman.Tab.AdminContactsGroupRight.bjs Pman.Tab.AdminContactsGroupRight.js --- Pman.Tab.AdminContactsGroupRight.bjs | 3 ++- Pman.Tab.AdminContactsGroupRight.js | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Pman.Tab.AdminContactsGroupRight.bjs b/Pman.Tab.AdminContactsGroupRight.bjs index 8967eb1..0f4b829 100644 --- a/Pman.Tab.AdminContactsGroupRight.bjs +++ b/Pman.Tab.AdminContactsGroupRight.bjs @@ -35,7 +35,8 @@ { "listeners": { "beforeload": "function (_self, o)\n{\n if (!o.params) {\n o.params = {}\n }\n var s = Pman.Tab.Groups.grid.getSelectionModel().getSelections();\n if (!s.length) {\n o.params.group_id = -1;\n } else {\n o.params.group_id = s[0].data.id;\n }\n if (o.params.group_id < 0) {\n _this.grid.getView().el.mask(\"You can not set permissions for that group\");\n return false;\n }\n _this.grid.getView().el.unmask();\n return true;\n \n}", - "update": "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.Request({\n url : baseURL + '/Roo/GroupRights.php',\n method :'POST',\n params : {\n id : record.data.id,\n active: record.data.active\n \n },\n success : function() {\n // do nothing\n \n _this.grid.ds.remove(record);\n \n },\n failure : function() \n {\n Roo.MessageBox.alert(\"Error\", \"saving failed\", function() {\n _this.grid.footer.onClick('first');\n });\n }\n });\n}" + "update": "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.Request({\n url : baseURL + '/Roo/GroupRights.php',\n method :'POST',\n params : {\n id : record.data.id,\n active: record.data.active\n \n },\n success : function() {\n // do nothing\n \n _this.grid.ds.remove(record);\n \n },\n failure : function() \n {\n Roo.MessageBox.alert(\"Error\", \"saving failed\", function() {\n _this.grid.footer.onClick('first');\n });\n }\n });\n}", + "load": "function (_self, records, options)\n{\n Roo.each(records, function(e){\n var k = e.data.accessmask.split('');\n Roo.each(k, function(ee){\n e.data.set('accessmask_'+ee, 1);\n });\n });\n}" }, "*prop": "dataSource", "remoteSort": true, diff --git a/Pman.Tab.AdminContactsGroupRight.js b/Pman.Tab.AdminContactsGroupRight.js index e105de0..c9184fa 100644 --- a/Pman.Tab.AdminContactsGroupRight.js +++ b/Pman.Tab.AdminContactsGroupRight.js @@ -132,6 +132,15 @@ Pman.Tab.AdminContactsGroupRight = new Roo.XComponent({ }); } }); + }, + load : function (_self, records, options) + { + Roo.each(records, function(e){ + var k = e.data.accessmask.split(''); + Roo.each(k, function(ee){ + e.data.set('accessmask_'+ee, 1); + }); + }); } }, remoteSort : true, -- 2.39.2