Pman.register({
modKey : '001-Pman.Tab.AdminProjectMembers',
module : Pman.Tab.AdminProjectMembers,
- region : '',
- parent : false,
- name : "unnamed module",
+ region : 'east',
+ parent : Pman.Tab.AdminProjectManager,
+ name : "Pman.Tab.AdminProjectMembers",
disabled : false,
permname: ''
});
this.panel = parentLayout.addxtype({
xtype: 'GridPanel',
xns: Roo,
- title : "Person",
- fitToframe : true,
- fitContainer : true,
- tableName : 'Person',
- background : true,
- region : 'center',
listeners : {
activate : function() {
_this.panel = this;
}
}
},
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'east',
+ tableName : 'Person',
+ title : "Person",
grid : {
xtype: 'Grid',
xns: Roo.grid,
- autoExpandColumn : 'name',
- loadMask : true,
listeners : {
render : function()
{
});
}
},
+ filter : 'S',
+ autoExpandColumn : 'name',
+ loadMask : true,
dataSource : {
xtype: 'Store',
xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ if (!_this.memberBtn) {
+ return false;
+ }
+ options.params.project_member_filter = _this.memberBtn.pressed;
+ var pm = Pman.Tab.AdminProjectManager;
+ if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) {
+ return false;
+ }
+ var sel = pm.grid.getSelectionModel().getSelected();
+ switch(_this.grid.filter) {
+ case 'S': // staff
+ options.params.company_id_comptype='OWNER';
+ options.params.project_member_of = sel.data.id;
+ break;
+ case 'O': // owner..
+ options.params.company_id = sel.data.client_id;
+ options.params.project_member_of = sel.data.id;
+ break;
+ case 'A': // not owner or staff..
+ options.params['!company_id'] = sel.data.client_id;
+ options.params['!company_id_comptype'] ='OWNER';
+ options.params.project_member_of = sel.data.id;
+ }
+
+ }
+ },
remoteSort : true,
sortInfo : { field : 'name', direction: 'ASC' },
proxy : {
footer : {
xtype: 'PagingToolbar',
xns: Roo,
- pageSize : 25,
displayInfo : true,
- displayMsg : 'Displaying Person{0} - {1} of {2}',
- emptyMsg : 'No Person found'
+ displayMsg : ' ',
+ emptyMsg : 'No Person found',
+ pageSize : 25
},
toolbar : {
xtype: 'Toolbar',
}
},
enableToggle : true,
+ pressed : true,
text : "Staff",
toggleGroup : 'appm'
},
enableToggle : true,
text : "Other",
toggleGroup : 'appm'
+ },
+ {
+ xtype: 'Fill',
+ xns: Roo.Toolbar
+ },
+ {
+ xtype: 'Button',
+ xns: Roo.Toolbar,
+ listeners : {
+ toggle : function (_self, pressed)
+ {
+
+ _this.grid.footer.onClick('first');
+ },
+ render : function (_self)
+ {
+ _this.memberBtn = _self;
+ }
+ },
+ enableToggle : true,
+ text : "Members"
}
]
},
{
xtype: 'ColumnModel',
xns: Roo.grid,
- header : 'Name',
- width : 200,
- dataIndex : 'name',
+ dataIndex : 'is_member',
+ header : 'Member',
+ width : 60,
renderer : function(v) { return String.format('{0}', v); }
},
{
xtype: 'ColumnModel',
xns: Roo.grid,
- header : 'Email',
+ dataIndex : 'name',
+ header : 'Name',
+ sortable : true,
width : 200,
- dataIndex : 'email',
renderer : function(v) { return String.format('{0}', v); }
},
{
xtype: 'ColumnModel',
xns: Roo.grid,
- dataIndex : 'company_id_name',
- header : 'Company',
- width : 75,
- renderer : function(v) { return String.format('{0}', v); }
+ dataIndex : 'email',
+ header : 'Email',
+ width : 100,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true
},
{
xtype: 'ColumnModel',
xns: Roo.grid,
- dataIndex : 'is_member',
- header : 'Member',
- width : 75,
+ dataIndex : 'company_id_name',
+ header : 'Company',
+ sortable : true,
+ width : 120,
renderer : function(v) { return String.format('{0}', v); }
}
]