Since HTML Treegrid was designed to be integrated with third party libraries from the ground up, it is quite easy to make it work with a lot of the opensource and commercial libraries available. In this blog post, we will cover a feature that we developed for one of our customers, addition of the right click feature. This particular customer was using the jQuery version of the product, so we added support using an open source right click menu jQuery plugin. Below is the screenshot of this functionality :

The code to accomplish this is quite straightforward:
First we include the third party menu plugin (MIT licensed):
<script type="text/javascript" src="http://wwwendt.de/tech/demo/jquery-contextmenu/jquery.ui-contextmenu.js"></script>
Then, we set it up:
$("#gridContainer").contextmenu({
delegate: ".flexDataGridDataCell",
menu: [
{title: "Copy Cell", cmd: "copyCell", uiIcon: "ui-icon-copy"},
{title: "Copy Row", cmd: "copyRow", uiIcon: "ui-icon-copy"},
{title: "Copy Table", cmd: "copyTable", uiIcon: "ui-icon-copy"}
]
,
select: function(event, ui) {
var grid =document.getElementById('gridContainer').component;
if(!grid.currentCell)
grid.currentCell = grid.getBodyContainer().getCellFromMouseEventTarget(ui.target[0].component);
if(ui.cmd == 'copyCell'){
grid.onCellContextMenuItemClick()
}else if(ui.cmd == 'copyRow'){
grid.onRowContextMenuItemClick()
}else if(ui.cmd == 'copyTable'){
grid.onTableContextMenuItemClick()
}
}
});
The key pieces here are the css class that we use to attach to the grid. This makes the menu appear only on those cells. Then, we handle the right click. In the handling mechanism, we identify the cell that the right click happened on:
grid.currentCell = grid.getBodyContainer().getCellFromMouseEventTarget(ui.target[0].component);
Finally, we call the methods from the grid's API to perform the actual copy operation. You should receieve a copy of this along with your trial package. If not, please reach out to support and we will be glad to help you!
The code below demonstrates this functionality.
CustomContextMenu.html (6.34 kb)