Reputation: 97
I have a modal panel which will appear when a link is clicked with a listener config. The link is placed inside a grid. The problem is when the link is clicked the modal is appearing with no data. Please help.
listeners : {
click : function() {
Ext.create('Ext.data.Store', {
storeId:'myStore',
fields:['qname'],
data:{'items':[
{ 'qname': 'Lisa'},
{ 'qname': 'Bart'},
{ 'qname': 'Homer'},
{ 'qname': 'Marge'}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
Ext.create('Ext.window.Window', {
title : 'Add Survey',
titleAlign : 'center',
id : 'surveyWindow',
height : 400,
width : 300,
//modal : true,
layout : 'fit',
closeAction:'close',
store:Ext.data.StoreManager.lookup('myStore'),
items : {
xtype : 'grid',
id :'addSurveyGrid',
border : false,
columns : [{
xtype : 'rownumberer'
},{
header : 'Survey Name',
sortable : false,
dataIndex : 'qname',
flex : 1
}]
}
}).show();
}
}
Upvotes: 0
Views: 729
Reputation: 8895
You are passing the store
to the Window
, not the grid
. Fixed that for you.
Upvotes: 2