Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Sep 15, 2008 03:28
open dhtmlx forum
DHX Grid : Context Menu for merged Cell

Hi there,
I am merging cells using context menu option "Merge Cells" in the Grid.
Can I have context menu option only for those merged cells as "DeMerge Cells" ????
Answer posted by Support on Sep 15, 2008 09:15
dhtmlxMenu (it is used as the grid's context menu) allows to hide and show its items.
For example context menu can initially contain two items "Merge Cells" and "DeMerge Cells", but "DeMerge Cells" should be hidden (it can be done using hideButtons method):
 
cMenu.menu.hideButtons(id_of_demerge);

And if cell is merged, "Merge Cells" has to be hidden:

cMenu.menu.hideButtons(id_of_merge);

cMenu.menu.showButtons(id_of_demerge);

Please, see the dynamic context menu sample n the documentation: dhtmlxGrid/samples/context_menu/pro_context_dynamic.html (http://dhtmlx.com/docs/products/dhtmlxGrid/samples/context_menu/pro_context_dynamic.html)


Answer posted by Tejas Shah on Sep 15, 2008 21:29
Hi,
    Thats what I want to know. How to identify whether a particular cell is merged or not ????
Answer posted by Support on Sep 16, 2008 09:38
You can try to use the following approach:

var isColSpan = grid.cells(id,index).cell.colSpan;