Ext 4 Treepanel context menu not showing at target
Ext 4 treepanel context menu not showing at the target node.. My code is as below.. Please anybody help me to resolve it.
var onContextMenu = function (view, record, item, index, e) {
var selNode = record;
if (Ext4.getCmp("mainContext") != null) {
Ext4.getCmp("mainContext").destroy();
}
var menu = createContextMenu(selNode);
e.preventDefault();
menu.showAt(item);
}
var tree = Ext4.create('Ext4.tree.Panel', {
animate: true,
enableDD: true,
id: "filterTree",
border: false,
renderTo: self.containerId,
store: treeStore,
rootVisible: false,
layout: {
type: 'fit',
padding: '5',
align: 'left'
},
listeners: {
afterrender: function () {
this.getEl().setStyle('height', 'auto');
this.body.setStyle('height', 'auto');
this.getView().getEl().setStyle('height', 'auto');
}
}
});
tree.on('itemcontextmenu', onContextMenu);
Whats wrong with this code??
1 Attachment(s)
Get Icon Element of the each node in the tree??
How can i get the icon element of each node in the tree??
If i didnt specify
then menu will be shown like this
Attachment 28654
Any idea why is it so?