A small test case would be helpful so we can see what you are doing.
Code:
Ext.application({
name: 'Fiddle',
launch: function() {
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "detention",
leaf: true
}, {
text: "homework",
expanded: true,
children: [{
text: "book report",
leaf: true
}, {
text: "algebra",
leaf: true
}]
}, {
text: "buy lottery tickets",
leaf: true
}]
}
});
var menuContext = new Ext.menu.Menu({
items: [{
text: 'Do something'
}],
listeners: {
itemclick: function(item) {
// handle click
}
}
});
Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody(),
viewConfig: {
listeners: {
itemcontextmenu: function(view, rec, item, index, e) {
e.stopEvent();
menuContext.showAt(e.getXY());
return false;
}
}
}
});
}
});