Hi JACQUES
HACHE,
Greetings from Syncfusion
support.
We have checked your query
and we have prepared a sample to show and hide the expand and collapse items in
context menu using their ID. In this sample, we have used contextMenuOpen
event to hide the expand and collapse item from the list by passing the id
value in the hideItems method. We have attached the sample and code snippets
for your reference. Please check the below sample and code snippets for more
details,
Code Snippets:
|
[Index.ts]
let contextMenuOpen:
EmitType<ContextMenuOpenEventArgs> = (
args?:
ContextMenuOpenEventArgs
) => {
let record: IGanttData =
args.rowData;
var menuObj =
document.getElementById('ContextMenu_contextmenu').ej2_instances[0];
if (args.type !== 'Header') {
menuObj.hideItems(['expandrow', 'collapserow'], true);
}
};
|
Sample: https://stackblitz.com/edit/rsh4k5-2xpj1l?file=index.ts
Regards,
Gopinath M