PDA

View Full Version : OnClick of Vbox component doesn't get fired ...



ssk_hari
18 Mar 2011, 3:50 AM
My requirement is, 'on click of anywhere in the component 'comp1 , it should connect to a HTML file 'details.html''. But, it does not happen ... Is there any click event for the vBox component ? Can anyone help me where I am wrong ... Code snippet :

var comp1 = new Ext.Container({
width: 1000,
height: 130,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
html: 'GE Strother'
},{
html: '903873 CF34-8C'
}]
});

Ext.setup({ onReady: function () {

var homeScreen = new Ext.Panel({
layout: {
type: 'vbox',
align: 'stretch'
},
fullscreen:true,
items: [{
dockedItems:comp1,
handler: function() {
window.open('details.html','_self');
}
}]
});


Thanks,
Hari.

kathleenr
18 Mar 2011, 7:59 AM
I am also facing the same issue. Any help please? Thanks.


how to get rid of blemishes (http://acne.besthelptips.com/)
garlic breath tips (http://garlic-breath.besthelptips.com/)

ssk_hari
21 Mar 2011, 3:46 AM
Solution : Don't create Vbox as a container. Create it as a panel. And place the handler code like below ... This works
var comp1 = new Ext.Panel({
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
html: 'GE Strother'
},{
html: '903873 CF34-8C'
}]
});
comp1.on('afterrender', function(){
this.body.on('click', function(){window.location.href="details.html"});
});

Thanks,
Hari.