+ ],
+ "listeners" : {
+ "beforeload" : [
+ "function (_self, o)",
+ "{",
+ " if(!_this.active_company_button.pressed){",
+ " o.params['!company_id_comptype'] = 'OWNER';",
+ " }",
+ " ",
+ " o.params['query[search]'] = _this.searchBox.getValue();",
+ " ",
+ " if (!_this.activeButton) {return; false;}",
+ " ",
+ " if (_this.companyCombo && _this.companyCombo.getValue()) {",
+ " o.params.company_id = _this.companyCombo.getValue();",
+ " }",
+ " ",
+ " ",
+ " o.params.active = _this.activeButton.pressed ? 0 : 1;",
+ " ",
+ " if(_this.active_company_button.pressed){",
+ " o.params.company_id = 0;",
+ " }",
+ " ",
+ " var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel();",
+ " ",
+ " if (!c) { ",
+ " return false;",
+ " }",
+ " ",
+ " var tms = c.grid.getSelectionModel().getSelected();",
+ " ",
+ " if (!tms) {",
+ " return false;",
+ " }",
+ " ",
+ " if(c.tableName == 'Groups'){",
+ " o.params['query[in_group]'] = tms.data.id;",
+ " o.params['query[type]'] = 2; // group type..",
+ " }else{",
+ " o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country;",
+ " o.params['query[in_group]'] = 0;",
+ " o.params['query[type]'] = 2;",
+ " }",
+ " /*",
+ " if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {",
+ " ",
+ " ",
+ " ",
+ " }",
+ " ",
+ " if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){",
+ " var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected();",
+ " ",
+ " if (!tms) {",
+ " return false;",
+ " }",
+ " ",
+ " }",
+ " */",
+ " //o.params['query[name]'] = _this.searchBox.getValue();",
+ " ",
+ "}"
+ ],
+ "update" : [
+ "function (_self, record, operation)",
+ "{",
+ " if (operation != 'commit') {",
+ " return;",
+ " }",
+ " // only used to change active status.",
+ " ",
+ " new Pman.Request({",
+ " url : baseURL + '/Roo/Person.php',",
+ " method :'POST',",
+ " params : {",
+ " id : record.data.id,",
+ " active: record.data.active",
+ " ",
+ " },",
+ " success : function() {",
+ " // do nothing",
+ " ",
+ " _this.grid.ds.remove(record);",
+ " ",
+ " },",
+ " failure : function() ",
+ " {",
+ " Roo.MessageBox.alert(\"Error\", \"saving failed\", function() {",
+ " _this.grid.footer.onClick('first');",
+ " });",
+ " }",
+ " });",
+ "}"
+ ]
+ },
+ "remoteSort" : true,
+ "xtype" : "Store"