Steve,
You have to listen for the "BeforeContextMenu" in table context menu and you can prevent there based on the condition whatever you needed.
Here is the code to do this,
var ganttControl = $gantt_container.data("GanttControl");
var tableContextMenu = ganttControl.TableContextMenu;
tableContextMenu.BeforeContextMenu.subscribe(function ($trigger, e) {
// To support IE8
//var wbsvalue = ganttControl.SelectedActivity.WBSID_M();
var wbsvalue = ganttControl.SelectedActivity.WBSID;
// To convert the WBS value into integer value.
// So, it will convert 1.x as 1 and will apply the same setting for it's child activities as well.
if (parseInt(wbsvalue) == 1) {
// To disable the outdent context menu.
tableContextMenu.Items.Outdent.disabled = true;
}
});
Thanks,
- Raja.