// 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.AdminCompanies',
- module : Pman.Tab.AdminCompanies,
- region : 'center',
- parent : false,
- name : "unnamed module",
- disabled : false,
- permname: ''
- });
-});
-
-Pman.Tab.AdminCompanies = new Roo.util.Observable({
-
- panel : false,
- disabled : false,
- parentLayout: false,
-
- add : function(parentLayout, region)
+Pman.Tab.AdminCompanies = new Roo.XComponent({
+ part : ["Admin","Companies"],
+ order : '030-Pman.Tab.AdminCompanies',
+ region : 'center',
+ parent : 'Pman.Tab.Admin',
+ name : "Pman.Tab.AdminCompanies",
+ disabled : false,
+ permname : 'Admin.Companies',
+ _tree : function()
{
-
var _this = this;
- this.parentLayout = parentLayout;
-
- this.panel = parentLayout.addxtype({
+ var MODULE = this;
+ return {
xtype: 'NestedLayoutPanel',
xns: Roo,
+ region : 'center',
title : "Companies",
layout : {
xtype: 'BorderLayout',
{
xtype: 'GridPanel',
xns: Roo,
- title : "Companies",
- fitToframe : true,
- fitContainer : true,
- tableName : 'Companies',
- background : true,
- region : 'center',
listeners : {
activate : function() {
_this.panel = this;
}
}
},
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'Companies',
+ title : "Companies",
grid : {
xtype: 'Grid',
xns: Roo.grid,
render : function()
{
_this.grid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
+ _this.dialog = Pman.Dialog.Companies;
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');
});
+
+
+ },
+ rowclick : function (_self, rowIndex, e)
+ {
+ try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}
}
},
autoExpandColumn : 'name',
load : function (_self, records, options)
{
try {
- Pman.Tab.Office.grid.footer.onClick('refresh');
+ Pman.Tab.AdminOffice.grid.footer.onClick('refresh');
} catch (e) {}
+ },
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+ try {
+ o.params['query[name]'] = _this.searchBox.getValue();
+ } catch(e) { return false; }
}
},
remoteSort : true,
- sortInfo : { field : 'code', direction: 'ASC' },
+ sortInfo : { field : 'name', direction: 'ASC' },
proxy : {
xtype: 'HttpProxy',
xns: Roo.data,
xns: Roo,
pageSize : 25,
displayInfo : true,
- displayMsg : 'Displaying Companies{0} - {1} of {2}',
- emptyMsg : 'No Companies found'
+ displayMsg : "Displaying Companies{0} - {1} of {2}",
+ emptyMsg : "No Companies found"
},
toolbar : {
xtype: 'Toolbar',
listeners : {
show : function (_self)
{
+
+ },
+ specialkey : function (_self, e)
+ {
+ if (e.getKey() == 13) {
+ _this.grid.footer.onClick( 'first' );
+ }
+ },
+ render : function (_self)
+ {
_this.searchBox = _self;
}
}
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Add",
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
listeners : {
click : 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()
{
});
}
- }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Edit",
+ icon : Roo.rootURL + 'images/default/tree/leaf.gif'
},
{
xtype: 'Button',
sortable : true,
width : 90,
renderer : function (v,x ,r) {
- return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
+ //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
+ return v;
}
},
{
xns: Roo.grid,
dataIndex : 'code',
header : 'Ref#',
+ sortable : true,
width : 50,
renderer : function(v) { return String.format('{0}', v); }
},
xns: Roo.grid,
dataIndex : 'name',
header : 'Name',
+ sortable : true,
width : 200,
renderer : function(v,x,r) {
- return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);
+ return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);
}
},
{
xns: Roo.grid,
dataIndex : 'email',
header : 'Email',
+ sortable : true,
width : 100,
renderer : function (v) {
return (v.length && v.indexOf('@') > 0 ) ?
{
xtype: 'ColumnModel',
xns: Roo.grid,
+ dataIndex : 'address',
header : 'Address',
+ sortable : true,
width : 200,
- dataIndex : 'address',
renderer : function(v) { return String.format('{0}', v); }
},
{
},
south : {
xtype: 'LayoutRegion',
- xns: Roo
+ xns: Roo,
+ height : 150,
+ split : true,
+ titlebar : true
}
}
- });
- this.layout = this.panel.layout;
-
+ };
}
});