Pman.Tab.AdminContactsGroupRight.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 14 Sep 2012 07:09:21 +0000 (15:09 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 14 Sep 2012 07:09:21 +0000 (15:09 +0800)
Pman.Tab.AdminContactsGroupRight.js

Pman.Tab.AdminContactsGroupRight.bjs
Pman.Tab.AdminContactsGroupRight.js

index 47fd8ca..03313ec 100644 (file)
@@ -22,7 +22,7 @@
                 {
                     "listeners": {
                         "|render": "function() \n{\n    _this.grid = this; \n    if (!_this.dialog) {\n        _this.dialog = Pman.Dialog.PersonEdit;\n        \n    }\n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                        "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n        _this.dataUpdate = typeof(_this.dataUpdate) =='undefined' ?  {} : _this.dataUpdate;\n        \n        var di = this.colModel.getDataIndex(columnIndex);\n        var i = di.split('_').shift();\n        var k = di.split('_').pop();\n        if (i != 'accessmask') {\n            return;\n        }\n        var rec = _this.grid.ds.getAt(rowIndex);\n        if(k == 'AA'){\n            var fm = rec.data.FullMask.split('');\n            Roo.each(fm, function(e){\n                rec.set(i+'_'+e, rec.data[i+'_'+k] ? 0 : 1);\n            });\n        } \n        rec.set(i+'_'+k, rec.data[i+'_'+k] ? 0 : 1);\n        //rec.data.accessmask = rec.data.accessmask + rec\n        //Roo.log(rec);\n        _this.dataUpdate[rec.data.id] = rec.data.accessmask;\n\n        //rec.commit();\n         \n        \n}"
+                        "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n        _this.dataUpdate = typeof(_this.dataUpdate) =='undefined' ?  {} : _this.dataUpdate;\n        \n        var di = this.colModel.getDataIndex(columnIndex);\n        var i = di.split('_').shift();\n        var k = di.split('_').pop();\n        if (i != 'accessmask') {\n            return;\n        }\n        var rec = _this.grid.ds.getAt(rowIndex);\n        var fm = rec.data.FullMask.split('');        \n        if(k == 'AA'){\n\n            Roo.each(fm, function(e){\n                rec.set(i+'_'+e, rec.data[i+'_'+k] ? 0 : 1);\n            });\n        } \n        rec.set(i+'_'+k, rec.data[i+'_'+k] ? 0 : 1);\n        \n        var newmask = '';\n        Roo.each(fm, function(e) {\n            if (rec.data[i+'_'+e] === 1) {\n        \n                newmask += e;\n            }\n        \n        });        \n        \n        //rec.data.accessmask = rec.data.accessmask + rec\n        //Roo.log(rec);\n        _this.dataUpdate[rec.data.id] = newmask;\n\n        //rec.commit();\n         \n        \n}"
                     },
                     "*prop": "grid",
                     "ddGroup": "groupDD",
index 771dfdb..3b256e6 100644 (file)
@@ -59,16 +59,27 @@ Pman.Tab.AdminContactsGroupRight = new Roo.XComponent({
                                 return;
                             }
                             var rec = _this.grid.ds.getAt(rowIndex);
+                            var fm = rec.data.FullMask.split('');        
                             if(k == 'AA'){
-                                var fm = rec.data.FullMask.split('');
+                    
                                 Roo.each(fm, function(e){
                                     rec.set(i+'_'+e, rec.data[i+'_'+k] ? 0 : 1);
                                 });
                             } 
                             rec.set(i+'_'+k, rec.data[i+'_'+k] ? 0 : 1);
+                            
+                            var newmask = '';
+                            Roo.each(fm, function(e) {
+                                if (rec.data[i+'_'+e] === 1) {
+                            
+                                    newmask += e;
+                                }
+                            
+                            });        
+                            
                             //rec.data.accessmask = rec.data.accessmask + rec
                             //Roo.log(rec);
-                            _this.dataUpdate[rec.data.id] = rec.data.accessmask;
+                            _this.dataUpdate[rec.data.id] = newmask;
                     
                             //rec.commit();