xtype: 'Button',
xns: Roo.Toolbar,
listeners : {
- click : function()
+ toggle : function (_self, pressed)
{
- if (!_this.dialog) return;
- _this.dialog.show( { id : 0 } , function() {
- _this.grid.footer.onClick('first');
- });
+ if (pressed) {
+ _this.grid.filter = 'S';
+ }
+ _this.grid.footer.onClick('first');
}
},
- cls : 'x-btn-text-icon',
+ enableToggle : true,
text : "Staff",
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
+ toggleGroup : 'appm'
},
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Edit",
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/tree/leaf.gif',
listeners : {
- click : function()
+ toggle : function (_self, pressed)
{
- var s = _this.grid.getSelectionModel().getSelections();
- if (!s.length || (s.length > 1)) {
- Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
- return;
+ if (pressed) {
+ _this.grid.filter = 'O';
}
- if (!_this.dialog) return;
- _this.dialog.show(s[0].data, function() {
- _this.grid.footer.onClick('first');
- });
-
+ _this.grid.footer.onClick('first');
}
- }
+ },
+ enableToggle : true,
+ text : "Owners",
+ toggleGroup : 'appm'
},
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Delete",
- cls : 'x-btn-text-icon',
- icon : rootURL + '/Pman/templates/images/trash.gif',
listeners : {
- click : function()
+ toggle : function (_self, pressed)
{
- Pman.genericDelete(_this, 'Person');
+ if (pressed) {
+ _this.grid.filter = 'A';
+ }
+ _this.grid.footer.onClick('first');
}
- }
+ },
+ enableToggle : true,
+ text : "Other",
+ toggleGroup : 'appm'
}
]
},
colModel : [
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Id',
- width : 75,
- dataIndex : 'id',
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Office',
- width : 75,
- dataIndex : 'office_id',
- renderer : function(v) { return String.format('{0}', v); }
- },
{
xtype: 'ColumnModel',
xns: Roo.grid,
dataIndex : 'name',
renderer : function(v) { return String.format('{0}', v); }
},
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Phone',
- width : 200,
- dataIndex : 'phone',
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Fax',
- width : 200,
- dataIndex : 'fax',
- renderer : function(v) { return String.format('{0}', v); }
- },
{
xtype: 'ColumnModel',
xns: Roo.grid,
{
xtype: 'ColumnModel',
xns: Roo.grid,
+ dataIndex : 'company_id_name',
header : 'Company',
width : 75,
- dataIndex : 'company_id',
renderer : function(v) { return String.format('{0}', v); }
},
{