Hi, I trying to add a custom delete command on the toolbar and I need to get the selected row and data. I'm using Server binding and I tried using some of the answers in the forum but it still didn't work.
The alert is always showing undefined. Can someone please point me in the right direction please?
The Id is defined in the model and is a hidden column
function deleteCommand(e) {
var grid = $('#reimbursementsGrid').data('kendoGrid');
var rows = grid.select();
rows.each(
function () {
var record = $(this).data();
alert('Selected : ' + record.Id);
}
)
}
The Id is defined in the model and is a hidden column
@(Html.Kendo().Grid(Model)
.Name("reimbursementsGrid")
.DataSource(dataSource => dataSource
.Server()
.Model(model =>
{
model.Id(r => r.Id);
...
.Columns(columns =>
{
columns.Bound(o => o.Id).Hidden(true);
...