PDA

View Full Version : How do I get my control in this layout?



PCSpectra
11 Jan 2010, 10:16 AM
var viewport = new Ext.Viewport({
layout: 'border',
renderTo: Ext.getBody(),
items: [{
region: 'north',
xtype: 'panel',
contentEl: 'header'
},{
region: 'center',
layout:'border',
defaults: {
collapsible: true,
split: true
},
items: [{
region:'north',
title: 'Header Details',
height: 200,
collapsible: false
},{
region: 'center',
title: 'Sequences',
height: 400,
layout: 'fit',
collapsible: false,
items: [rps_grid]
},{
region: 'south',
title: 'Dimensions',
height: 200
}]
},{
region: 'west',
split: true,
width: 580,
layout: 'accordion',
layoutConfig: {
titleCollapse: true,
animate: true
},
items: [rpd_grid, rps_grid, rdi_grid,{
title: 'Part Models',
html: '<p>List of part models!</p>'
}]
}]
});

I have want to duplicate the contents of rps_grid but in the section titled 'Sequences', which I have tried to do by using items: [rps_grid] which obviously does not work, what am I missing?

Can someone show me what I need to do inorder to get that section render the same control rps_grid, which the accordian section does render just fine. I want the same in the other panel.

Cheers,
Alex

CrazyEnigma
11 Jan 2010, 1:00 PM
Try posting your code in a CODE tag so that we can see what you are doing.

What kind of error are you getting?

What is rps_grid? Does it contain 'id'? Is it a config for the grid or an EXT Component Grid?

PCSpectra
11 Jan 2010, 2:48 PM
I am sure I did but it came out like crap anyways:



var viewport = new Ext.Viewport({
layout: 'border',
renderTo: Ext.getBody(),
items: [{
region: 'north',
xtype: 'panel',
contentEl: 'header'
},{
region: 'center',
layout:'border',
defaults: {
collapsible: true,
split: true
},
items: [{
region:'north',
title: 'Header Details',
height: 200,
collapsible: false
},{
region: 'center',
title: 'Sequences',
height: 400,
layout: 'fit',
collapsible: false,
items: [rps_grid]
},{
region: 'south',
title: 'Dimensions',
height: 200
}]
},{
region: 'west',
split: true,
width: 580,
layout: 'accordion',
layoutConfig: {
titleCollapse: true,
animate: true
},
items: [rpd_grid, rps_grid, rdi_grid,{
title: 'Part Models',
html: '<p>List of part models!</p>'
}]
}]
});


Hopefuly that is better

This section of code:



region: 'center',
title: 'Sequences',
height: 400,
layout: 'fit',
collapsible: false,
items: [rps_grid]



I just want to use the rpd_grid like I do in the accordina layout but doing the above nothing happens???

Cheers,
Alex

CrazyEnigma
11 Jan 2010, 3:29 PM
Read your code without the CODE tags, you didn't answer my questions.

Do you have ID in GRID specified? If you do, you cannot render all the grids multiple times. But because I can't see what you are doing, I can only speculate what the problem is.

PCSpectra
11 Jan 2010, 3:39 PM
What would it look like if I specified ID inside the rps_grid object? As a JSON attribute?

I might, not sure to be honest.