Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by nikita on Sep 10, 2008 08:36
open dhtmlx forum
Custom right Click menu (grid)

Hello, I am wondering if it is possible to add a custom right click menu to the Grid object.

What I would like to do is possibly create a edit menu that would be linked to the cell selected.

I know this is pretty vague in functionality, and that dhtmlxGrid probably does not support it, but we would like to see if this ability can be done with some coding.

Thank you.
Answer posted by Support on Sep 10, 2008 09:23
The grid has native support for context menu 
           http://dhtmlx.com/docs/products/dhtmlxGrid/samples/context_menu/?un=1221065008000

If you want not use dhtmlxMenu, but some custom solution - you can use onRightClick event of grid, such event occurs when right mouse clicked over some cell and grid , and can be used a starting point for showing any kind of context menu. 
Answer posted by Nikita on Sep 11, 2008 15:00
Thank you for your reply, and it looks like context menu would do the trick, but is it possible to create config.xml in  menu.loadXML("config.xml");  using JSON object structure? None of the examples show that. Is XML version the only way to create context menu?

Thanks in advance.
Answer posted by Support on Sep 12, 2008 04:50
The data can be loaded only from XML. 
But menu allows dynamic construction as well - you can build context menu fully by js commands, without external XML usage. 

http://dhtmlx.com/docs/products/dhtmlxMenu/samples/context_menu/context_bulding_script.html?un=1221221509000