Reputation: 2449
I want to open a grid in Ext.Panel
. This is what I tried-
Var grid = Ext.create('Ext.grid.Panel', {
store: Ext.data.StoreManager.lookup('StoreId'),
columns: [
{ header: 'Resort', dataIndex: 'resort' },
{ header: 'Arrival', dataIndex: 'arrival' },
{ header: 'Guest', dataIndex: 'guest', flex: 1 }
]
renderTo: Ext.getBody()
});
Var panel = new Ext.Panel({
title: 'Accompanying Guest(s)',
id: 'panel',
items: [grid]
});
And I want to open this panel in a window -
var win = new Ext.Window({
layout: 'fit',
width: 900,
height: 600,
closeAction: 'hide',
plain: true,
items: [panel]
});
Whats wrong in my code?
Upvotes: 0
Views: 1626
Reputation: 30082
var win = new Ext.Window({
autoShow: true,
layout: 'fit',
width: 900,
height: 600,
closeAction: 'hide',
plain: true,
items: [{
xtype: 'gridpanel',
title: 'Accompanying Guest(s)',
store: Ext.data.StoreManager.lookup('StoreId'),
columns: [{
header: 'Resort',
dataIndex: 'resort'
}, {
header: 'Arrival',
dataIndex: 'arrival'
}, {
header: 'Guest',
dataIndex: 'guest',
flex: 1
}]
}]
});
Where do I start...
Upvotes: 1