// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
-
-
-// register the module first
-Pman.on('beforeload', function()
-{
- Pman.register({
- modKey : '001-Pman.Tab.AdminOffice',
- module : Pman.Tab.AdminOffice,
- region : 'center',
- parent : Pman.Tab.AdminCompanies,
- name : "Pman.Tab.AdminOffice",
- disabled : false,
- permname: ''
- });
-});
-
-Pman.Tab.AdminOffice = new Roo.util.Observable({
-
- panel : false,
- disabled : false,
- parentLayout: false,
-
- add : function(parentLayout, region)
+Pman.Tab.AdminOffice = new Roo.XComponent({
+ part : ["Admin","Office"],
+ order : '001-Pman.Tab.AdminOffice',
+ region : 'center',
+ parent : 'Pman.Tab.AdminCompanies',
+ name : "Pman.Tab.AdminOffice",
+ disabled : false,
+ permname : '',
+ _tree : function()
{
-
var _this = this;
- this.parentLayout = parentLayout;
-
- this.panel = parentLayout.addxtype({
+ var MODULE = this;
+ return {
xtype: 'GridPanel',
xns: Roo,
listeners : {
background : true,
fitContainer : true,
fitToframe : true,
- region : 'center',
+ region : 'south',
tableName : 'Office',
title : "Offices / Departments / Sub-Companies",
grid : {
xtype: 'Grid',
xns: Roo.grid,
- autoExpandColumn : 'name',
- loadMask : true,
listeners : {
render : function()
{
_this.grid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
+ _this.dialog =Pman.Dialog.Office;
if (_this.panel.active) {
this.footer.onClick('first');
}
rowdblclick : function (_self, rowIndex, e)
{
if (!_this.dialog) return;
- _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
+ _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
_this.grid.footer.onClick('first');
});
}
},
+ autoExpandColumn : 'name',
+ loadMask : true,
dataSource : {
xtype: 'Store',
xns: Roo.data,
beforeload : function (_self, o)
{
try {
- var sm = Pman.Tab.Companies.grid.getSelectionModel();
+ var sm = Pman.Tab.AdminCompanies.grid.getSelectionModel();
sm = sm.getSelected();
if (!sm || !sm.data.id) {
// mask??
return false;
}
+
}
},
remoteSort : true,
xns: Roo,
pageSize : 25,
displayInfo : true,
- displayMsg : 'Displaying Office{0} - {1} of {2}',
- emptyMsg : 'No Office found'
+ displayMsg : "Displaying Office{0} - {1} of {2}",
+ emptyMsg : "No Office found"
},
toolbar : {
xtype: 'Toolbar',
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Add",
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
listeners : {
click : function()
{
if (!_this.dialog) return;
- _this.dialog.show( { id : 0 } , function() {
+
+ var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;
+ _dialog.show( {
+ id : 0 ,
+ company_name : cdata.name,
+ company_id : cdata.id,
+ address : cdata.address,
+ phone : cdata.tel,
+ fax : cdata.fax,
+ email : cdata.email
+ } , function() {
_this.grid.footer.onClick('first');
- });
+ });
}
- }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Add",
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
},
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Edit",
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/tree/leaf.gif',
listeners : {
click : function()
{
return;
}
if (!_this.dialog) return;
+ s[0].data.company_name = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data.name;
_this.dialog.show(s[0].data, function() {
_this.grid.footer.onClick('first');
});
}
- }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Edit",
+ icon : Roo.rootURL + 'images/default/tree/leaf.gif'
},
{
xtype: 'Button',
{
xtype: 'ColumnModel',
xns: Roo.grid,
- header : 'Address',
- width : 200,
dataIndex : 'address',
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- header : 'Role',
- width : 200,
- dataIndex : 'role',
+ header : 'Address',
+ width : 300,
renderer : function(v) { return String.format('{0}', v); }
}
]
}
- });
- this.layout = this.panel.layout;
-
+ };
}
});