Pman.Tab.PersonList.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 16 Dec 2010 02:24:36 +0000 (10:24 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 16 Dec 2010 02:24:36 +0000 (10:24 +0800)
Pman.Tab.PersonList.js

index 500613c..3d8fb81 100644 (file)
@@ -219,30 +219,16 @@ Pman.Tab.PersonList.prototype = {
                     },
                     cellclick : function (_self, rowIndex, columnIndex, e)
                     {
-                        var id = this.colModel.getDataIndex(colIndex);
-                        if (columnIndex > 0 ) {
+                        var di = this.colModel.getDataIndex(colIndex);
+                        if (di != 'active') {
                             return;
                         }
-                        var sel = _this.panel.tree.getSelectionModel().getSelectedNode();
-                        if (!sel || isNaN(parseInt(sel.id))) {
-                             
-                            return  ;
-                        }
-                        
+                         
                         var rec = _this.grid.ds.getAt(rowIndex);
-                        if (rec.data.has_perm) {
-                            if (rec.data.has_perm != sel.id) {
-                                Roo.MessageBox.alert("Error", "This is an inherited permission, Remove permission for parent category");
-                                return;
-                            }
-                            Roo.log('setting perm to 0');
-                            rec.set('has_perm', 0);
-                            rec.commit();
-                            // remove it only if it's the same..
-                            return;
-                        }
-                        rec.set('has_perm', sel.id);
+                        
+                        rec.set('active', rec.data.active ? 0 : 1);
                         rec.commit();
+                         
                         
                         
                     }