PDA

View Full Version : Grid inside a button menu



susanta_vi
5 Oct 2012, 1:31 PM
I added a grid in menu on a button click. The grid loads and shows just fine. But when I click on header for "Sort Ascending", the menu goes away, I am not sure how to fix that.

Any help would be appriciated:

Thanks

code:
Code:

Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone'],
data: {
'items': [{
'name': 'Lisa',
"email": "lisa@simpsons.com",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "bart@simpsons.com",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "home@simpsons.com",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "marge@simpsons.com",
"phone": "555-222-1254"
}]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


var grid = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
text: 'Name',
dataIndex: 'name'
}, {
text: 'Email',
dataIndex: 'email',
flex: 1
}, {
text: 'Phone',
dataIndex: 'phone'
}],
height: 200,
width: 400,
});


Ext.create('Ext.Button', {
text: 'Menu button',
renderTo: Ext.getBody(),
arrowAlign: 'bottom',
menu: [{
xtype: grid
}]
});

scottmartin
5 Oct 2012, 3:50 PM
Duplicate post:
http://www.sencha.com/forum/showthread.php?245134

Scott.

susanta_vi
5 Oct 2012, 4:24 PM
I put it in both forums as members from community memeber doesnt ahve access to premium forum ....