PDA

View Full Version : extjs fisheye menu click



prajeesh_bs
2 May 2011, 4:57 AM
i have created a fisheye menu using the code


var fm = new Ext.ux.FisheyeMenu({
renderTo : 'dataView',
itemWidth : 60,
items : [{
text: 'Map',
imagePath: 'images/table_48.png',
url: 'http://maps.google.com'
}, {
text: 'Photo',
imagePath: 'images/table_48.png',
url: 'http://picasaweb.google.com'
}]


});

How to add customer listener for the menu. When i click on a menu item i need to get the text of that menu item.
I have tried like this


var fm = new Ext.ux.FisheyeMenu({
renderTo : 'dataView',
itemWidth : 60,
items : [{
text: 'Map',
imagePath: 'images/table_48.png',
url: 'http://maps.google.com'
}, {
text: 'Photo',
imagePath: 'images/table_48.png',
url: 'http://picasaweb.google.com'
}],
listeners: {
click: function () {
//function to get the name of menu item which is clicked
}
}


});


but this is not working. can anybody paste a sample code?

friend
2 May 2011, 5:51 AM
Here's a simple menu configuration block which illustrates the concept, where the 'defaults' config lets you apply the listener to all child items:



var m = new Ext.menu.Menu({
defaults: {
listeners: {
click: function(item, event) {
console.log(item.text);
}
}
},
items: [{
xtype: 'menucheckitem',
id: 'checkable',
text: 'Checkable Item',
checked: false
},{
xtype: 'button',
text: 'Click Me'
}]
});

prajeesh_bs
2 May 2011, 9:06 PM
hi friend,
I tried the way you described,but its not working.
i need to get the fisheye effect also. when i click on each menu item i need to get the name of menu item

prajeesh_bs
2 May 2011, 9:12 PM
seems like there is no click event for fisheyemenu..donno how to proceed further :(