I have the following code. i was able to determine the click on a row. but cant get the popup form to open when the row is selected.
@(Html.Kendo().Grid<grid.Model.entity>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.phone).Title("Phone").HeaderHtmlAttributes(new { style = "font-size:13px;" });
columns.Bound(p => p.address).Title("Home Address").HeaderHtmlAttributes(new { style = "font-size:13px;" });
columns.Bound(p => p.email).Title("Email").HeaderHtmlAttributes(new { style = "font-size:13px;" });
})
.ToolBar(toolbar =>
toolbar.Create()
)
.Editable(ed => ed.Mode(GridEditMode.PopUp))
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:730px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(30)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ID))
.Create(update => update.Action("EditingPopup_Create", "Welcome"))
.Read(read => read.Action("Info", "Welcome").Data("searchText"))
.Update(update => update.Action("EditingPopup_Update", "Welcome"))
)
.Resizable(resize => resize.Columns(true))
)
<script type="text/javascript">
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
$('table').click(function () {
var grid = $("#grid").data('kendoGrid');
grid.select().each(function () {
// how to open the form from here?
})
});
</script>