PDA

View Full Version : How to add an context menu in a <div> element?



robbie
19 Apr 2007, 6:47 PM
i know how to add an context menu in grid . for example

var cm_weektmpGrid = new Ext.menu.Menu('cm_weektmpGrid');

cm_weektmpGrid.add({ id: 'cm_btn_manage', text: 'config..',handler: this.showManageWeektmpView.createDelegate(this)});


grid_weektmp.doRowContextMenu = function (grid, rowIndex, e) {
e.stopEvent();
var coords = e.getXY();
cm_weektmpGrid.showAt([coords[0], coords[1]]);
}

grid_weektmp.addListener('rowcontextmenu', grid_weektmp.doRowContextMenu);



but now ,i create an

tryanDLS
19 Apr 2007, 6:58 PM
Look at how the grid source builds a content menu. You could likely do the same thing, rendering to a different target.

Dorkfest
24 Apr 2007, 6:57 PM
I needed the same thing found this plugin for JQuery:
http://www.trendskitchens.co.nz/jquery/contextmenu/. (1.6 KB compressed).