Context menu in Grid cell


Been working on doing this for 3 days now. Decided it might be time to give up and ask for some help :mrgreen:

I am looking primarily at this example here : … _menu.html

And as I am not using XML to load the menu I am also looking at this example here : … ta_loading

It plain doesn’t work. If I follow the example (to the letter) I get page load errors, namely

A pop up alert “Incorrect cell type ‘context’”

A debugger window telling me ‘Error: Object doesn’t support property or method ‘setSubContext’’

I of course have knocked up a little test page to show what I am working with so hopefully someone can tell my where I am messing up.

<!DOCTYPE html> <!-- HTML 5 -->
<html xmlns="" xml:lang="en" lang="en">
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="description" content="" />	 
	<meta name="keywords" content="" /> 
	<meta name="author" content="" />
	<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" /> 
	<link rel="STYLESHEET" type="text/css" href="dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgrid.css">
    <script src="dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
    <script src="/dhtmlxGrid/dhtmlxMenu/codebase/dhtmlxmenu.js"></script>
	<script src="dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
	<script src="dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
    <script src="/dhtmlxGrid/dhtmlxMenu/codebase/ext/dhtmlxmenu_ext.js"></script>
	<script src="/dhtmlxGrid/dhtmlxMenu/codebase/excells/dhtmlxgrid_excell_context.js"></script>
<div id="menuData" style="display: none;">  
	<div id="m1" text="File"> // the first top menu item
		<div id="m11" text="New"><hotkey>Ctrl+N</hotkey></div>// the first child item
		<div id="ms1" type="separator"></div> // a separator	
		<div id="m12" text="Open"><hotkey>Ctrl+O</hotkey></div> // the second child item  

<div id="mygrid_container" style="width:500px; height:270px; background-color:white;"></div>

	data = { 
		{ id:1, 
		"399"] }

	menu = new dhtmlXMenuObject();

	mygrid = new dhtmlXGridObject('mygrid_container');
	mygrid.setSubContext(menuData, 0, 0);
	menu.loadFromHTML("menuData", true, function() {


Bit concerning that given all the information provided no one has any ideas. It’s a simple enough thing I am trying to do, and the examples themselves just plain don’t work. Would like to know if it’s a bug in the examples, or a bug in the product.

In your code:

  <script src="/dhtmlxGrid/dhtmlxMenu/codebase/excells/dhtmlxgrid_excell_context.js">

note, that the dhtmlxgrid_excell_context.js is located at

<script src="/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_context.js">

Thanks for that. At least a different error message now.

Object doesn’t support property or method ‘hideContextMenu’
dhtmlxgrid_excell_content.js, line 10 character 231.

It’s progress I suppose. :laughing:

Not much I can do as this is error is being thrown from the product source. Any ideas?

Thanks in advance

Please, provide with a complete demo, where the issue can be reconstructed.
Here you can find a tutorial: … leted_demo