We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ejGrid with custom context menu item: How to get the target row (i.e. primary key) in contextClick event handler function?

Thread ID:





131206 Jun 28,2017 07:26 AM UTC Jun 30,2017 07:31 AM UTC Angular 3
Tags: ejGrid
Thomas Wittwer
Asked On June 28, 2017 07:26 AM UTC

Setup: ejGrid with custom context menu item

How to get the target row (i.e. primary key) in contextClick event handler function?

Please advise.

Jayaprakash Kamaraj [Syncfusion]
Replied On June 29, 2017 03:19 PM UTC

Hi Thomas, 

Thank you for contacting Syncfusion support. 

We have achieved your requirement using contextOpen and contextClick event of ejGrid. In contextOpen event, we need to store current target row data in global variable and then we can get the primaryKey value in contextClick event using that gloabal variable. Please refer to the below help document and code example. 

<ej-grid id="Grid" [dataSource]="gridData" [editSettings]="editSettings" (contextOpen)="contextopen($event)" allowSorting="true" (contextClick)="contextclick($event)" [contextMenuSettings]="contextSettings" [toolbarSettings]="toolbarSettings"> 
        <e-column field="EmployeeID" [isPrimaryKey]="true"></e-column> 
        <e-column field="FirstName" [editType]= "editType" [dataSource]="data1" ></e-column> 
        <e-column field="LastName" [allowEditing]="false"></e-column> 
export class GridComponent { 
    public gridData: any; 
       public data1 : any; 
    public pagesize: number; 
       public targetRowData : any; 
    this.targetRowData = e.model.currentViewData[e.rowIndex]         


Jayaprakash K. 

Thomas Wittwer
Replied On June 29, 2017 06:47 PM UTC

Thank you for your support.



Jayaprakash Kamaraj [Syncfusion]
Replied On June 30, 2017 07:31 AM UTC

Hi Thomas,  
Thanks for the update. 
Please get back to us if you need any further assistance.   
Jayaprakash K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon