BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Id | Devices | Client Name |
1 | 12 | Test1 |
2 | 13 | Test2 |
Hi Fabio,
Thanks for using Syncfusion Products.
We are glad to let you know that we have achieved your requirement using “Column template” Grid feature by which we have bounded click event to the Model class property. Please refer the following code snippets.
@(Html.EJ().Grid<EJGrid.Models.Order>("Editing") col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Template(true).TemplateID("#colTemplate").Width(95).Add(); )
<script type="text/x-jsrender" id="colTemplate"> <span style="text-decoration: underline" onclick="templateColHandler(this)">{{:Freight}}</span> </script> <script> function templateColHandler(e) { alert(e.textContent) } </script> |
For your convenience we have created a sample and the same can be downloaded from below link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/130822/EJGrid-1693858473.zip
Please let us know if you need any further assistance.
Regards,
Alan Sangeeth S
Hi Fabio,
Thanks for the update.
We would like to let you know that current td element will be passed to the “templeteColHandler” method argument “e”. Using the element td in argument variable “e”, we can find the row index by which we can get the current row details using “currentViewData” Grid property. Please refer the following code snippets.
function templateColHandler(e) { var gridObj = $("#Grid").ejGrid("instance") var rowIndex = $(e).closest("tr").index(); var currentRecord = gridObj.model.currentViewData[rowIndex] ... } |
For your convenience we have modified the sample and the same can be downloaded from below link.
Sample: http://www.syncfusion.com/uploads/user/directTrac/127277/EJGrid1977275079.zip
Please let us know if you need any further assistance.
Regards,
Alan Sangeeth S