advarot
5 Aug 2009, 7:10 AM
Hi,
I'm working with extjs 2.1,
I'm trying to have a border layout - this one I succeeded.
But then I tries to put more complex objects in each region and this fails.
At the beginning I trying creating the GridPanel and Panel separately and assign them ot the layout which failed.
then I tried using the xtype, this also didn't work.
Here the code I have:
insuranceContainer = new Ext.Viewport({
renderTo: 'insurance',
layout: 'border',
items: [{
title: 'Insured Information',
html: '<p>Cell Insured Information content</p>',
region: 'center'
},{
title: 'Agent Information',
html: '<p>Cell Agent Information content</p>',
width:300,
region: 'east'
},{
title: 'Policies',
//This part worked!!! html: '<p>Cell Policies content</p>',
width:600,
height: 150,
xtype: 'panel',
columns: createPoliciesColumnModel(),
region: 'south'
}
]
});
insuranceContainer.setVisible(true);
insuranceContainer.doLayout();
insuranceContainer.show();
function createPoliciesColumnModel(){
var cm = new Ext.grid.ColumnModel([
{
//Policy#
id: 'policyId',
header:'Policy#'
,sortable:true
,width: 100
,align: 'left'
,hideable: false
},
{
//Type
id: 'type'
,header:'Type'
,sortable:true
,align: 'left'
,width: 70
},
{
//PolicyHolder
id: 'policyHolder',
header:'PolicyHolder'
,sortable:true
,width: 100
,align: 'left'
},
{
//Relationship
id: 'relationship',
header:'Relationship'
,sortable:true
,width: 100
,align: 'left'
},
{
//Status
id: 'status',
header:'Status'
,sortable:true
,width: 70
,align: 'left'
},
{
//Agent Info
id: 'agentInfo',
header:'Agent Info.'
,sortable:true
,width: 200
,align: 'left'
}
]);
return cm;
}
I'm working with extjs 2.1,
I'm trying to have a border layout - this one I succeeded.
But then I tries to put more complex objects in each region and this fails.
At the beginning I trying creating the GridPanel and Panel separately and assign them ot the layout which failed.
then I tried using the xtype, this also didn't work.
Here the code I have:
insuranceContainer = new Ext.Viewport({
renderTo: 'insurance',
layout: 'border',
items: [{
title: 'Insured Information',
html: '<p>Cell Insured Information content</p>',
region: 'center'
},{
title: 'Agent Information',
html: '<p>Cell Agent Information content</p>',
width:300,
region: 'east'
},{
title: 'Policies',
//This part worked!!! html: '<p>Cell Policies content</p>',
width:600,
height: 150,
xtype: 'panel',
columns: createPoliciesColumnModel(),
region: 'south'
}
]
});
insuranceContainer.setVisible(true);
insuranceContainer.doLayout();
insuranceContainer.show();
function createPoliciesColumnModel(){
var cm = new Ext.grid.ColumnModel([
{
//Policy#
id: 'policyId',
header:'Policy#'
,sortable:true
,width: 100
,align: 'left'
,hideable: false
},
{
//Type
id: 'type'
,header:'Type'
,sortable:true
,align: 'left'
,width: 70
},
{
//PolicyHolder
id: 'policyHolder',
header:'PolicyHolder'
,sortable:true
,width: 100
,align: 'left'
},
{
//Relationship
id: 'relationship',
header:'Relationship'
,sortable:true
,width: 100
,align: 'left'
},
{
//Status
id: 'status',
header:'Status'
,sortable:true
,width: 70
,align: 'left'
},
{
//Agent Info
id: 'agentInfo',
header:'Agent Info.'
,sortable:true
,width: 200
,align: 'left'
}
]);
return cm;
}