PDA

View Full Version : Click event been fired even if no event wirrten for it when using the prperty itemTpl



akshar_jamgaonkar
11 Jan 2013, 5:17 AM
HI,

I have created a simple app, in which a panel and a view are dynamically pouplated on click of grid row. Everything is working fine however when i click on the view row i get a error as "o is undefined". I have however not specified any event handler for that view.

below is my viewport code

Ext.define('Cricket.view.Viewport', {
extend: 'Ext.container.Viewport',
layout: 'fit',

requires: [
'Cricket.view.CountryList',
'Cricket.view.TeamList',
'Cricket.view.CountryDetails'
],

initComponent: function() {
this.items = {
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
width: 250,
xtype: 'panel',
id: 'west-region',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'countrylist',
flex: 1
}, {
html: 'Ad',
height: 250,
xtype: 'panel'
}]
}, {
xtype: 'container',
flex: 1,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'countrydetails',
height: 250
}, {
xtype: 'teamlist',
flex: 1
}]
}]
};

this.callParent();
}
});



// Below is my view code


Ext.define('Cricket.view.CountryDetails', {
extend: 'Ext.view.View',
alias: 'widget.countrydetails',
store: 'CountryResults',
itemTpl: '<div>{desc}</div>',
update: function(item) {
if(item)
this.callParent([item.data]);
}
});



Any help would be appriciated.

mitchellsimoens
13 Jan 2013, 9:13 AM
What class/method is this being fired on?

akshar_jamgaonkar
13 Jan 2013, 11:45 PM
its been fired on widget.countrydetails, however i have not defined any event or event handler for the same.


When the application loads widget.countrydetails class is used to display all the country details ,when i click on the list generated by widget.countrydetails for first time the evnet does not get fired.

But second time when the list is generated again the event gets fired on same class.