Currently I'm trying to access the value of a cell in the grid, but the property is always undefined.
@(Html.Kendo().Grid<IA.Models.PatientInfo>()
.Name("PatientGrid")
.Columns(columns =>
{
columns.Bound(c => c.PatientId).Title("Id").Width(50);
columns.Bound(c => c.FullName).Width(200);
columns.Bound(c => c.DOB).Width(140).Title("Date of Birth").Format("{0:dd/MM/yyyy}");
columns.Bound(c => c.MANumber).Width(90);
//columns.Command(command => { command.Destroy(); }).Width(50);
columns.Command(c => c.Custom("Delete").Click("open")).Width(50);
})
.Filterable()
.Sortable()
.Selectable()
.Pageable(pageable => pageable
.PageSizes(true)
.ButtonCount(5))
//.HtmlAttributes(new { style = "height: 80px" })
.Events(ev => ev.DataBound("function(){this.trigger('change')}"))
.DataSource(dataSource => dataSource
.Ajax()
.Destroy(update => update.Action("Destroy", "Provider"))
.Read(read => read.Action("Patient_Read", "Provider", new { id = Model.ProviderId }))
.PageSize(10)
.ServerOperation(false)
.Model(model =>
{
model.Id(m => m.PatientId);
})
)
)
<script type="text/javascript">
function open(e) {
e.preventDefault();
var row = $(e.currentTarget).closest("tr");
var test = row.PatientId;
alert(test);
}
</script>
I've also I've also tried using selectItem() and that doesn't seem to work either.