Hi Agne,
Thanks for your update.
In the latest Essential studio version(15.3.0.29), we are able to render the submenu inside another submenu as a template in the contextmenu of ejGrid control.
Refer the below code example.
[app.component.html]
<ej-grid id="Grid" [dataSource]="gridData2" [allowPaging]="true" [allowSorting]="true"
[contextMenuSettings]="contextMenuSettings" (contextClick)= "contextClick($event)">
<e-columns>
----
</e-columns>
</ej-grid>
---------------------------------------
[app.component.ts]
export class AppComponent {
public contextMenuSettings;
contextClick(e: any){
alert(e.text);
}
constructor() {
this.contextMenuSettings = {
enableContextMenu: true, contextMenuItems: [],
customContextMenuItems: [{ id: 'clear', text: "Clear Selection" },
{ id: 'hide', text: "Hide column" }
],
subContextMenu: [{
contextMenuItem: "hide",
template: "#template"
}]
};
}
}
--------------------------------------------
[index.html]
<script type="text/x-jsrender" id="template">
<ul>
<li>
<a>OrderID</a>
<ul>
<li><a>10248</a></li>
<li><a>10249</a></li>
</ul>
</li>
<li><a>CustomerID</a></li>
<li><a>EmployeeID</a></li>
</ul>
</script>
|
Refer the below screen shot.
We have prepared a sample and it can be downloadable from the below location.
Refer the help documentation.
Regards,
Thavasianand S.