or
$("#shortList").kendoGrid({
height: 400,
columns: [{
field: "name",
title: "Name"
}],
dataSource: {
data: [
{
name: "Test"
}]
}
});
then I get this exception when trying to add a row using API later:
TypeError: 'undefined' is not an object (evaluating 'this._set.indexOf')
$("#shortList").data("kendoGrid").addRow();
Using the latest commercial version of your software. How do I add a row using API?
function showSelectedImage() { var grid = $("#grid").data("kendoGrid"); //var data = grid.dataItem(grid.select()); grid.select().each(function () { var data = grid.dataItem($(this)); if (null != data) { $("#documentPreview").attr("src", data.ImageUrl); $("#documentPreview").attr("alt", data.DocumentId); $("#documentView").attr("src", data.ImageUrl); $("#documentView").attr("alt", data.DocumentId); $("#openImageHyperLink").attr("href", data.ImageUrl); if ($("#documentPreview").is(":hidden")) { $('#documentPreview').slideDown("slow", "easein", null); } if (null != data.ExtraPageUrls) { buildPager(data.ExtraPageUrls); } } }); }[{name:"Olivia", email:"olivia@olivia.com", showContactInfo: 1 },{name:"Michael", email:"michael@yahoo.com",showContactInfo: 0},{name:"Peterl", email:"pe@ter.com",showContactInfo: 0}]if (showContactInfo) // make the custom command visible for this row<div id="myform"> <input type="date" id="myDate" name="myDate" data-date-msg="Invalid date" data-bind="value: myField" /> <br /> <button id="show" type="button">Show selected</button> <button id="clear" type="button">Clear</button></div><script> $(document).ready(function () { var model = kendo.observable({ myField: new Date() }); $("#myDate").kendoDatePicker(); kendo.bind($("#myDate"), model); var validatable = $("#myform").kendoValidator().data("kendoValidator"); $("#show").click(function () { if (validatable.validate()) { alert('Selected: ' + model.get("myField")); } }); $("#clear").click(function () { model.set('myField', null); }); });</script>