or
@{ string controller = ViewContext.GetCurrentController(); string action = ViewContext.GetCurrentAction(); string methodName = "_GetNewGridRows" + "_" + action; WFObjectListViewModel objectListViewModel = Model; }@(Html.Kendo().Grid(objectListViewModel.ObjectDataList) .Name("Grid_" + objectListViewModel.UniqueID) .Columns(columns => { columns.Bound(c => c.ID) .Hidden(true) .Title("wfID"); columns.Bound(c => c.AspSite) .Hidden(true) .Title("aspSite"); for (int i = 0; i < objectListViewModel.FolderColumns.Count; i++) { var id = i; var itemAttributesId = id + 2; if (objectListViewModel.FolderColumns[i].Type == "text") { string template = null; if (Model.FolderColumns[i].ColumnName == "subject") { string wfID = "\"#=ItemAttributes[" + 0 + "]#\""; string aspSite = "\"#=ItemAttributes[" + 1 + "]#\""; string jsOpenWindow = "javascript:openWindow(" + wfID + ", " + aspSite + ")"; template = string.Format("<a href='{0}' style='white-space: nowrap;'>{1}</a>", jsOpenWindow, "#=ItemAttributes[" + itemAttributesId + "]#"); } else { template = string.Format(Model.FolderColumns[id].Template, "#=ItemAttributes[" + itemAttributesId + "]#"); } columns.Bound(c => c.ItemAttributes) .ClientTemplate("#=gridClientTemplate(Unread, 'begin')#" + template + "#=gridClientTemplate(Unread, 'end')#") .Title(Model.FolderColumns[id].ColumnDisplayName) .Hidden(Model.FolderColumns[i].Hidden) .Column.Member = Model.FolderColumns[id].ColumnUniqueName; } else if ((Model.FolderColumns[id].Type == "image") || (Model.FolderColumns[id].Type == "deadline") || (Model.FolderColumns[id].Type == "bit")) { int columnWidth = 22 + (Model.FolderColumns[id].ColumnDisplayName.Length * 5); columns.Bound(c => c.ItemAttributes) .ClientTemplate("#=gridClientTemplate(Unread, 'begin')#" + string.Format(Model.FolderColumns[id].Template, "#=ItemAttributes[" + itemAttributesId + "]#") + "#=gridClientTemplate(Unread, 'end')#") .Title(Model.FolderColumns[id].ColumnDisplayName) .Width(columnWidth) .Hidden(Model.FolderColumns[i].Hidden) .Column.Member = Model.FolderColumns[id].ColumnUniqueName; } } }) .EnableCustomBinding(true) .DataSource(dataSource => dataSource.Ajax() .Read(read => read.Action(methodName, controller, new { folderID = Model.FolderID, searchFilterJson = ViewData["hiddenSearchFilter_Data"] })) .PageSize(Model.EntriesPerPage) .Total(Model.TotalItems) ) .Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn)) .Selectable() .Scrollable() .Resizable(resizing => resizing.Columns(true)) .Events(events => events.DataBound("onObjectDataListBound_" + controller + "_" + action)) .Pageable(pageing => pageing.Enabled(true).Refresh(Model.AllowGridRefresh).Input(true).Numeric(false).PreviousNext(true).PageSizes(new int[] {3, 5, 10, 15, 25, 50, 75, 100 })))@(Html.Kendo().Grid<BulletinModel>() .Name("Grid") .Editable(ed => ed.Mode(GridEditMode.PopUp).Window(w => w.Width(950))) .Selectable() .Scrollable(scrollable => scrollable.Virtual(true)) .Sortable() .HtmlAttributes(new { @style = "height: 600px;" }))
We have a page with Kendo UI grid and simple search field with Kendo UI Autocomplete inititated on it. Search field has a placeholder "Type resource key".
On any version of internet explorer, when user navigates grid using pagination, the "GetResourceValues" function, that populates grid, gets search field's placeholder value as request parameter:
sort=&page=2&pageSize=25&group=&filter=&language=-&searchKeyword=Type+resource+key&resourceType=
While in other browsers the request looks like this:
sort=&page=3&pageSize=25&group=&filter=&language=-&searchKeyword=-&resourceType=
This leads to empty grid results after using pagination. Can it be Kendo UI bug?
Here is part of the code:
@(Html.Kendo().Grid<ResourceViewModel>()
.Name("resourcesList")
.Events(e => e.DataBound("handleDataBound"))
.Pageable()
.Resizable(resizable => resizable.Columns(true))
.ClientDetailTemplateId("resourceDetailsTemplate")
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("errorHandler"))
.ServerOperation(true)
.Batch(false)
.Model(model => model.Id(res => res.Id))
.Create(create => create.Action("CreateResource", "Resources"))
.Update(update => update.Action("UpdateResource", "Resources"))
.Destroy(destroy => destroy.Action("DeleteResource", "Resources"))
.Read(read => read.Action("GetResources", "Resources").Data("searchCriteria"))
.PageSize(25))
.Sortable()
.Scrollable()
.ToolBar(factory =>
factory.Template(@<text>
<div class="k-grid-toolbar-row">
<input id="resourceSearch" class="k-grid-toolbar-search-field" />
</div>
</text>)))
<script>
$(document).ready(function () {
var autocompleteSymbol = $("#resourceSearch").kendoAutoComplete({
dataTextField: "Key",
minLength: 2,
dataValueField: "Key",
filter: "contains",
placeholder: "Type resource key",
dataSource: {
type: "json",
transport: {
read: "Resources/GetAutoComplete",
maxRows: 50000
}
},
change: filterResources
});
});
</script>
@(Html.Kendo().ListView<AttachedFile>() .Name("attachedFilesListView") .TagName("div") .ClientTemplateId("attachedFilesTemplate") .DataSource(dataSource => dataSource .Model(model => { model.Id(f => f.AttachedFileID); model.Field(f => f.EntityTableKey).DefaultValue(Model.CorrectiveActionItemID); }) .Read(read => read.Action("Files_Read", "CorrectiveActionItem", new { correctiveActionItemId = Model.CorrectiveActionItemID })) .Destroy(destroy => destroy.Action("Files_Delete","CorrectiveActionItem")) .PageSize(4) ) .Pageable() .Editable())@model AttachedFile@(Html.Kendo().Upload() .Name("files") .Async(a => a.Save("SaveFile", "CorrectiveActionItem", new { correctiveActionItemId = Model.EntityTableKey }) .AutoUpload(true)))