or
@(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(model => model.MEMBER_ID); columns.Bound(model => model.R_MONTH); columns.Bound(model => model.PRINT_YN); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); }) .ToolBar(toolbar => { toolbar.Create(); }) .Editable(editable => editable.Mode(GridEditMode.InLine)) .Pageable() .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false) .Events(events => events.Error("error_handler")) .Model(p => p.Id(model => model.SR_NO)) .Create(update => update.Action("Editing_Create", "Repost")) .Read(read => read.Action("Editing_Read", "Repost")) .Update(update => update.Action("Editing_Update", "Repost")) .Destroy(update => update.Action("Editing_Destroy", "Repost")) ))@model IEnumerable<Biblioteka.ViewModels.BookViewModel>@{ ViewBag.Title = "Index";}<h2>Index</h2>@(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.BookGenreId).Groupable(false); columns.Bound(p => p.Title); columns.Bound(p => p.Author); }) .Pageable() .Sortable() .Scrollable() .Filterable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false) ))namespace Biblioteka.Controllers{ public class BooksController : Controller { // // GET: /Books/ public ActionResult Index() { return View(GetData()); } private IEnumerable<dynamic> GetData() { LibraryEntities ctx; ctx = new LibraryEntities(); return ctx.Book; } private JsonResult GetView() { return Json(GetData()); } }}namespace Biblioteka.ViewModels{ public class BookViewModel { public int BookId { get; set; } public string Author { get; set; } public string Title { get; set; } public Nullable<System.DateTime> ReleaseDate { get; set; } public string ISBN { get; set; } public int BookGenreId { get; set; } public int Count { get; set; } public System.DateTime AddDate { get; set; } public Nullable<System.DateTime> ModifiedDate { get; set; } public BookViewModel() { } public BookViewModel(Book book) { this.BookId = book.BookId; this.Author = book.Author; this.Title = book.Title; this.ReleaseDate = book.ReleaseDate; this.ISBN = book.ISBN; this.BookGenreId = book.BookGenreId; this.Count = book.Count; this.AddDate = book.AddDate; this.ModifiedDate = book.ModifiedDate; } public void Update(Book book) { book.BookId = this.BookId; book.Author = this.Author; book.Title = this.Title; book.ReleaseDate = this.ReleaseDate; book.ISBN = this.ISBN; book.BookGenreId = this.BookGenreId; book.Count = this.Count; book.AddDate = this.AddDate; book.ModifiedDate = this.ModifiedDate; } }}@(Html.Kendo().Grid<FieldViewModel>(Model.Fields)
.HtmlAttributes(new { @class = "fullScreen" })
.Name("formFields")
.ClientDetailTemplateId("formFieldsTemplate")
.Columns(columns =>
{
columns.Bound(e => e.Key);
columns.Bound(e => e.DisplayName);
columns.Bound(e => e.FieldTypeName);
columns.Bound(e => e.Order);
columns.Bound(e => e.IsMandatory);
columns.Bound(e => e.Type);
})
.Pageable()
.Sortable()
.Scrollable()
.Selectable()
.Resizable(resize => resize.Columns(true))
.Groupable()
.Filterable()
.DataSource(dataSource => dataSource.Ajax().ServerOperation(false).Model(model => model.Id(e => e.Key))))
and details template<script id="formFieldsTemplate" type="text/kendo-tmpl">
@(Html.Kendo().Grid<FieldViewModel>()
.Name("FormField_#=Key#")
.ClientDetailTemplateId("formFieldsTemplate")
.Columns(columns =>
{
columns.Bound(e => e.Key);
columns.Bound(e => e.DisplayName);
columns.Bound(e => e.FieldTypeName);
columns.Bound(e => e.Order);
columns.Bound(e => e.IsMandatory);
columns.Bound(e => e.Type);
})
.DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("LoadFieldDetails", "Forms", new { formPath = Model.Schema, rootElementName = Model.Root ,fieldKey = "#=Key#" })))
.Pageable()
.Sortable()
.Selectable()
.ToClientTemplate())
</script>
Type property, so what I want to do is not to show any details view and no arrow on the entire row when Type property is set to the specific value. How can I achieve it?@(Html.Kendo().AutoCompleteFor(m => m.NewIssue.Responsible) .MinLength(3) .HtmlAttributes(new { @class="autocomplete" }) .Events(e => e.Change("removeTitle")) .DataSource(ds => ds.Read(r => r.Action("GetUserNames", "Ajax")) .ServerFiltering(true)))@(Html.Kendo().AutoCompleteFor(m => m.NewIssue.SiteNumber) .MinLength(3) .HtmlAttributes(new { @data_url = Url.Action("PopulateSite"), @class="autocomplete" }) .Events(e => e.Select("selectSite")) .DataSource(ds => ds.Read(r => r.Action("GetSites", "Ajax")) .ServerFiltering(true)))@model IEnumerable<Datamart.Models.ViewModels.LEAFundMap>@{ ViewBag.Title = "CreateFundMap"; var snapshot = Session["snapshot_id"] ?? Request.Params["snapshot_id"];}<h2>CreateFundMap</h2>@(Html.Kendo().Grid(Model).Name("Funds").Columns(cols => { cols.Bound(p => p.entity_fund).ClientTemplate("#=entity_fund#"); cols.Bound(p => p.fund_desc).ClientTemplate("#=fund_desc.fund_desc#"); }).ToolBar(commands => { commands.Save(); }) .Editable(edit => edit.Enabled(true).Mode(GridEditMode.InCell)).DataSource(ds => ds .Ajax() .Model(model => { model.Id(p => p.entity_fund); model.Field(p => p.entity_fund).Editable(false); }) // Configure RU --> .Read(read => read.Action("Fund_Read", "Draft").Data("additionalData")) .Update(update => update.Action("Fund_Update", "Draft").Data("additionalData")) //.ServerOperation(false) .Batch(true) .Events(events => events //.Change("onChange") // commented out because it causes an infinite loop .Error("onError") ) ) // <-- Configure RU )<script>function additionalData() { return { snapshot_id: "@snapshot" };}function onError(e, status) { if (e.errors) { var message = "The following errors have occurred:\n"; $.each(e.errors, function (key, value) { if (value.errors) { message += value.errors.join("\n"); } }); alert(message); }}function onChange() { var grid = $("#Funds").data("kendoGrid"); grid.dataSource.read();}</script>Hi. I just want to display a list of values that are retrieved serverside using AJAX. It calls the AJAX method successfully, but does not display the returned values.
Markup:
@(Html.Kendo().AutoComplete() .Name("EditNameAutoComplete") .DataSource(source => source.Read(read => read.Action("GetUsers", "Administration")) .ServerFiltering(true)))public JsonResult GetUsers() { string input = Request.Params["filter[filters][0][value]"]; var adValues = //Get names from Active Directory that start with our input var users = adValues.Select(user => user.CommonName).ToList(); users.Sort(); return Json(users); }