Index.html
<style>
.e-grid .e-customitem>span{
top: "30%";
position: absolute;
}
</style>
Component.html
<ej-grid #myGrid [contextMenuSettings]="contextMenuSettings"(contextOpen)="onContextMenuOpen($event)" (create)="onCreate($event)"></ej-grid>
Component.ts
export class GridComponent {
. . .
onCreate(args){
//Add the separator
$("#1").addClass("e-separator");
//Add icon to the items
$("#1").prepend("<span class='e-icon e-cancel'></span>");
$("#2").prepend("<span class='e-icon e-save'></span>");
}
} |
Thank you, it is very helpful!
I have one more question about this - maybe there is some possibility add images not using jQuery with prepend/append, but there is some grid context menu item property like imageUrl, icon or something like that? Or maybe this will be done in the future?