Hi Théo Armengou,
Thanks for contacting Syncfusion Forums.
Query 1: I can't seem to find the functions hideItems,
removeItems, insertAfter.
We can access the above functions in tree grid using below
code example,
|
// HTML Page
<ejs-treegrid #treegrid [dataSource]='data' …….>
<e-columns>
…………………………..
</e-columns>
</ejs-treegrid>
// TS Page
@ViewChild('treegrid')
public treegrid: TreeGridComponent;
contextMenuOpen(event: ContextMenuOpenEventArgs) {
this.treegrid.grid.contextMenuModule.contextMenu.hideItems(['referenceItem']); // using grid instance you can access the above functions
this.treegrid.grid.contextMenuModule.contextMenu.removeItems(this.currentMenuItems.map(v => v.text || ''));
this.currentMenuItems = [];
if (event.column && event.rowInfo?.rowData) {
..................
this.treegrid.grid.contextMenuModule.contextMenu.insertAfter(this.currentMenuItems, 'referenceItem');
}
}
|
Query 2: Different menu for each column that depends on
the column field and the value of the row
Using custom context menu, we can render the different customized
context menu items. For your convenience, we have created the sample please
refer to the below link.
https://stackblitz.com/edit/angular-cfft39?file=app.component.ts
In the above sample, we have showed the context menu option
only for the taskName column (i.e., tree column) and for parent rows alone as
like same you can achieve your requirements.
Please get back to us if you need further assistance. We will
be happy to assist you.
Regards,
Manivannan Padmanaban