I have an Ext.data.Store and a Ext.Panel with a list.
I add record dynamically with this command:
myStore.add({txt: r});
I would like to add a listener that when I click on a list record, it shows me the record data in a message box.
How can I do it?
Ext.data.store
var myStore = Ext.create('Ext.data.Store', {
storeId: 'MyStore',
fields: ['txt']
}); // create()
Ext.Panel
listpanel = new Ext.Panel({
layout: 'fit', // important to make layout as 'fit'
items: [
{
xtype: 'titlebar',
id: 'myTitle',
docked: 'top',
title: 'Before Change title'
},
{
//Definition of the list
xtype: 'list',
itemTpl: '{txt}',
store: myStore,
}]
});
You need to use
itemtapevent of theExt.Listcomponent.E.g