Hi
I'm trying to convert my site to utilise Kendo Grid, I'm trying to add a <div> that calls a javascript onClick using Column template but the javascript isn't being called. I suspect that it might have to do with how the data is loaded. Any idea on how I can add a clickable div through column template.
Also, how do i utilise Template instead of ClientTemplate ? what are the differences ?
I'm trying to convert my site to utilise Kendo Grid, I'm trying to add a <div> that calls a javascript onClick using Column template but the javascript isn't being called. I suspect that it might have to do with how the data is loaded. Any idea on how I can add a clickable div through column template.
Also, how do i utilise Template instead of ClientTemplate ? what are the differences ?
<%: Html.Kendo().Grid<
CIS.Models.Patients.PatientModel
>()
.Name("grid")
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("t1", "ttt")) // Set the action method which will return the data in JSON format
.PageSize(25)
)
.Columns(columns =>
{
columns.Bound(p => p.ID).ClientTemplate(
CIS.Models.Helpers.Controls.IconLink("Open", "ui-icon icon-folder-open", "ViewPatient", "Patients", new { patientID = "#= ID #" }) +
"<
div
title=\"Edit\" class=\"ui-icon icon-pencil edit-patient-btn\" patientID=\"#= ID #\" style=\"display: inline-block\"> </
div
>"+
"<
div
title=\"Remove\" class=\"ui-icon icon-trash remove-patient-btn\" patientID=\"#= ID #\" style=\"display: inline-block\"> </
div
>"
).Title("");
columns.Bound(p => p.initials).Title("Initial");
columns.Bound(p => p.dateOfBirth).Format("{0:dd/MM/yy}").Title("Date of Birth");
columns.Bound(p => p.gender).Title("Gender");
})
.Pageable()
.Sortable()
%>