I was just wondering if anyone has worked out how to add a right click custom menu to the header or footer of a tree grid.
I currently have
However I have no idea how to add a custom menu to anywhere outside of my actual grid items.
I have tried to add a context menu to “xhdr” with no success
You can add id for the grid header and use it as dhtmlxMenu context zone
Thanks for getting back to me.
I have added :
after where the class is added for xhdr (this.hdrBox.className=“xhdr”
and the following code in the initTreeGrid :
hdr_menu = new dhtmlXMenuObject("xhdr");
hdr_menu.addNewChild(hdr_menu.topId, 0, "new", "New”, false, "new.gif");
however this isn’t working.
Is there something I am missing?
Check the attached sample, it adds context menu to the header of grid.
1278946873.zip (122 KB)
Fantastic thank you. I was missing the
mygrid.hdrBox.id = "header";
I also added a menu to my footer
mygrid.ftr.id = "footer";
can i add menu for tree like this without using tree.enableContextMenu();