I have a Kendo Grid and template column
columns.Template(t => t.id)
.ClientTemplate("<button style='margin:2px' type='button' class='btn btn-success btn-xs' data-toggle='tooltip' data-placement='left' title='Change' onclick='getID()'><span class='glyphicon glyphicon-cog'></span></button>")
.Width(30)
.HtmlAttributes(new { @style = "text-align:center" });
And
function getID(e) {
debugger;
var grid = $("#Grid").data("kendoGrid");
var model = model.id
alert(model.id);
}
I'm just getting this error:
Uncaught TypeError: Cannot read property 'id' of undefined.
Why? What can I do to get a model ID where the button is clicked?
model
asmodel.id
then attempting to retrieve theid
property on what is now presumably a string or int. – Rory McCrossan