Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 14, 2007 14:29
open dhtmlx forum
How robust is the support for context menus on a treegrid? Essentially, I'm using a 1 column grid with a...

How robust is the support for context menus on a treegrid? Essentially, I'm using a 1 column grid with a tree column and I want different context menus to show up depending on which tree level is being clicked on. I couldn't readily find information on how to do so. I tried using the setOnBeforeContextMenu(func), but that seems to disable the menu (menu doesn't show up). Where can I add conditions that will help me decide which menu should be displayed and whether a menu should be

displayed or not.

Also, if I set a column type to tree, can I also make that column read-only?
Answer posted on Mar 14, 2007 14:30

> I tried using the setOnBeforeContextMenu(func),

This is correct solution, this event occurs before menu showing and retrieves element ID (combination of row and cell) - any operation against menu can be executed here.

You need to return true, from such event handler, in other case (if false or nothing returned) context menu will not be shown at all.

> Also, if I set a column type to tree, can I also make that column

> read-only?

Next command controls this behaviour:

                mygrid.enableTreeCellEdit(false);
Answer posted by Stanislav (Support) on Dec 10, 2014 11:26

Not much can be said in addition to the reply above, but you also can check download treeview and ghannt chart and find out what we have probably missed in our explanation.