Hi There,
I have a checkbox column in my grid, the change event works fine when page first loaded, but fails after page changed. Following is my code. Any help would be greatly appreciated.
@model IEnumerable<
WebApplication1.Models.ProductViewModel
>
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.ProductID).ClientTemplate("<
input
class
=
'checkBoxCustom'
type
=
'checkbox'
/>").Title(" ").Filterable(false).Width(50);
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice).Width(150);
//columns.Command(command => command.Destroy()).Width(150);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:350px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(2)
.ServerOperation(false)
//.Events(events => events.Error("errorHandler"))
.Model(model =>
{
model.Id(p => p.ProductID);
model.Field(p => p.ProductID).Editable(false);
})
)
)
<
script
>
$(document).ready(function () {
$('input.checkBoxCustom').on('change', function (e) {
alert('hi');
});
});
</
script
>