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. Image for the cookie policy date

Inquiry about columns template of EJ2 Grid.

Hello.
Thank you for your kind reply.

I tried to use template for the columns property in EJ2 Grid as I used in EJ1 Grid. I tried to use the same method as the attached file but it doesn't work.

In case of click event, variable and fixed specific value should be put together as parameter, and it was operated in the previous EJ1 Grid.

In Chrome developer tools Elements Tabs the button part under the template inside the Grid looked like this
-------------------- Chrome developer tools Elements Tabs -------------------------------------
......
<button title="Button" onclick="PopupAlert(" france')'="">France</button>
 ......
---------------------------------------------------------------------------------------------------------

Can I make an event work when a button is clicked?

Please confirm. Thank you.

Attachment: GridTemplate_5a79b2d5.zip

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team January 2, 2020 08:46 AM UTC

Hi Jeongkyu, 
 
Thanks for contacting Syncfusion support, 
 
We could see you would like to pass the parameters through template button click action. We suggest to use the &quot HTML entity instead of sign of quote(‘’). You are able to pass multiple parameters in button click action which is rendered by the column template. Please refer the below code example and sample for more information. 
[GridTemplate.html] 
<script id="ClickTemplate" type="text/x-jsrender"> 
      <button title="Button" onclick="PopupAlert(&quot;SomeData..&quot;, &quot;${ShipCountry}&quot;)'">${ShipCountry}</button> 
</script> 


Please get back to us, if you need further assistance. 

Regards, 
Seeni Sakthi Kumar S

Loader.
Live Chat Icon For mobile
Up arrow icon