How to get the row value on Kendo grid row selection change. I used a ajax method to bind the Kendo grid.
and js code snippet
goodsID always return undefined. Whats the wrong with this.
thanks
Santhosh
@(Html.Kendo().Grid<OnlineAB.Models.GoodsServiceModel>() .Name("GSSrcGrid") .Columns(columns => { columns.Bound(gs => gs.ID).Visible(false); columns.Bound(gs => gs.GSPrice).Groupable(false).Width(100); columns.Bound(gs => gs.GSTime).Width(100); columns.Bound(gs => gs.GSDescription).Width(200); columns.Bound(gs => gs.GSTitle).Width(150); columns.Bound(gs => gs.GSCode).Width(120); }) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetGoodsandService", "GS") .Data("GetParam")) .ServerOperation(false) ) .Sortable() .Scrollable() .Filterable() .RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ID)) .Selectable(s => s.Mode(GridSelectionMode.Single)) .Events(events => events.Change("GSSelectionChange")) )and js code snippet
function GSSelectionChange() { var gsgrid = $('#GSSrcGrid').data('kendoGrid'); var goods = gsgrid.select(); var goodsID = goods.data("id"); alert(goodsID);}goodsID always return undefined. Whats the wrong with this.
thanks
Santhosh