PDA

View Full Version : Grid and Form Panel in a Window



lucrativeu
30 Aug 2012, 5:28 AM
Hello, can anybody please help me out, I'm stuck with this issue? I want to display a grid and a form panel in a window but doesn't seem to be working. The sample of the code is shown below. Please help me out!!!

var win = Ext.create('Ext.window.Window', {
title: 'Salary Classification',
animCollapse: true,
width: 550,
height: 520,
layout: 'fit',
items: (simple,grid)
});
win.show()

tvanzoelen
30 Aug 2012, 5:35 AM
Specify an other layout on the window, now it is set on fit. It will only display the first.

Zdeno
30 Aug 2012, 5:37 AM
Check http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/layout-browser/layout-browser.html
(http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/layout-browser/layout-browser.html)

sword-it
30 Aug 2012, 6:03 AM
Hi lucrativeu,
First you have to remove the layout:'fit' from the window because fit layout only show first child. Review the following example which contain Grid and Form both inside window.



Ext.create('Ext.window.Window', {
title: 'My Window',
height: 300,
width: 400,
layout: 'form',
items:[ {
xtype: 'grid',
height: 100,
border: false,
columns: [{header: 'First Name'},{header: 'Last Name'}],
store: Ext.create('Ext.data.ArrayStore', {})
},
{
xtype:'form',
title: 'Simple Form',
border: false,
height: 150,
bodyStyle:'padding:10px',
defaultType: 'textfield',
items: {
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
},
buttons: [{
text: 'Submit'
}]
}]
}).show();

tvanzoelen
30 Aug 2012, 6:06 AM
and this

items: (simple,grid) will go wrong

it must be this

items: [simple,grid]

items is an array