Grid custom command with template doesn't trigger event

1 Answer 109 Views
Grid
Youssef
Top achievements
Rank 1
Youssef asked on 08 Feb 2022, 03:47 PM

I'm trying to use the custom command functionality in the grid component. When giving my custom command a template, the click event isn't triggered. the template is basically just a span so I can use my icon.

If I don't give an onclick event to the span, the click event is never triggered. But if I do give an onclick event it is triggered but I cannot access the dataItem object. So I am not able to retrieve the row data.

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 Feb 2022, 01:09 PM

Hi Youssef,

 

Thank you for writing to us.

Usually, you can achieve this requirement using the following approach:

var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
Can you modify the following live sample to demonstrate the issue you are facing and send the new URL back to me for further investigation?
https://netcorerepl.telerik.com/wmOQblvx0861ya9D33

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Youssef
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or