It's kind of difficult to describe in the subject, but here's the scenario. In an ASP.NET Core 3.1 web app, we have some different Kendo Grids that are generated by using the HTML Helper. Some of these use server operations while others do not. Following the information in the Persist State demo, I'm working on changes to save the grid options (sorting, filtering, page number, etc.) when the user navigates away from a page, then restore them the next time it's loaded. With a grid we have using server operations, this is working well so far. For a grid we have using client operations, on the other hand, I'm getting unexpected results.
Example:
@(Html.Kendo().Grid(new[]
{
new { ProductName = "Product 1", UnitPrice = 3.50 },
new { ProductName = "Product 2", UnitPrice = 5.30 }
})
.Name("TestGrid")
.NoRecords(n => n.Template("No records found"))
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
)
)
<script>
$(document).ready(function () {
var grid = $("#TestGrid").data("kendoGrid");
var options = grid.getOptions();
grid.setOptions(options);
});
</script>
If you comment out the JavaScript, you get a working grid. With the JavaScript in place, this should get the options from the grid, then immediately re-apply those same options (just for testing purposes) and the grid should end up looking the same as it did before. However, the setOptions() call seems to be triggering a POST back to the same page (with the data "sort=&group=&filter=") then wiping the data from the grid and showing the "No records found" message. However, since this grid is bound to a model property and has ServerOperation(false), all of the data needed is already at the client and there is no Ajax request that exists to get this data.
This is the code from viewing the source that was rendered by the code in the View from above:
<div id="TestGrid" name="TestGrid"></div><script>kendo.syncReady(function(){jQuery("#TestGrid").kendoGrid({"noRecords":{"template":"No records found"},"columns":[{"title":"Product Name","field":"ProductName","filterable":{"messages":{"selectedItemsFormat":"{0} selected items"},"checkAll":false},"encoded":true},{"title":"Unit Price","field":"UnitPrice","filterable":{"messages":{"selectedItemsFormat":"{0} selected items"},"checkAll":false},"encoded":true}],"scrollable":false,"dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})(),"transport":{"read":{"url":""},"prefix":""},"pageSize":20,"page":1,"groupPaging":false,"total":2,"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"ProductName":{"editable":false,"type":"string"},"UnitPrice":{"editable":false,"type":"number"}}}},"data":{"Data":[{"ProductName":"Product 1","UnitPrice":3.5},{"ProductName":"Product 2","UnitPrice":5.3}],"Total":2}}});});</script>
<script>
$(document).ready(function () {
var grid = $("#TestGrid").data("kendoGrid");
var options = grid.getOptions();
grid.setOptions(options);
});
</script>
I'm not sure why it's attempting an Ajax request, but that appears to be what's causing the problems. With the other grid we have that *does* use server operations, I'm assuming we're not having this same problem because it does actually require an Ajax request to read the data.
The Custom() DataSource has capability to set the initial Page of the grid:
.PageSize(20)
.Page(4)
While the Ajax() DataSource does not. It would be nice if it gets added.
Currently, you can use the page() method for local or .Ajax() bound grid:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/page
Or query:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/query
At moment the "ForeignKey" method supports only predicates. Is it possible to implement a String overload (a screenshot is attached)?
### Bug report
When the filter is applied through the search panel, the query (more specifically, the filter expressions) is not built correctly. This results in displayed rows that have values that do not match the value from the search panel.
### Reproduction of the problem
1. Enable Search panel and group paging of the grid.
2. Set a value in the search panel and group by a column.
3. Expand the group and verify that there are items with values that do not match the filter expression from the search panel.
Short video demonstration:
https://screencast-o-matic.com/watch/crXFlXVI3i0
### Expected/desired behavior
The returned results should comply with the filter expression built from the Search panel.
### TicketID:
_1543306
### Additional notes and explanation
The Search panel builds the filter expression with the logic operator "or". While this is correct when the actual query is further built from the data source's internals (group function of the kendo.data.js file), the filter will be built with the "or" logic instead of "and". This query has to be restructured in order to send two filter objects with the "and" logic. The first filter object should contain all filter expressions built from the search panel with the "or" logic operator and the second filter object should contain an expression with the operator "eq", the field by which the group is built, and the value. The two filter objects should be combined with the "and" logic.
### Environment
* **Kendo UI version:** 2021.3.1109
* **jQuery version:** 1.12.4
* **Browser:** [all]
### Bug report
The Column.Exportable option is not correctly serialized and cannot be used to export hidden columns.
### Reproduction of the problem
1. Set Column.Exportable(true) and Column.Hidden(true).
2. Export the grid and see that the column is not present in the exported file.
### TicketID:
1543405
### Environment
* **Kendo UI version:** 2021.3.1109
* **jQuery version:** 1.12.4
* **Browser:** [all]
When the Grid's Group Paging is enabled and its content is grouped, the Multicheckbox Filter doesn't filter the group data correctly.
The group shows rows that shouldn't be included when the column is filtered properly
The group should only show the filtered rows
1546090
### Bug report
When the Grid filter menu is customized with a DropDownList, the initial option defined by using the "index" property is not set.
### Reproduction of the problem
A Dojo sample for reproduction: https://dojo.telerik.com/OmeXUfaF
### Expected/desired behavior
The DropDownList should be initialized with an initially selected option.
### Environment
* **Kendo UI version: 2022.1.119
* **jQuery version: 1.12.4
* **Browser: [all]
The Grid's Pager pageSize DropDown selected value is not shown properly in the Less Material theme
The value of the DropDown should be shown as expected
### Bug report
The Kendo UI NumericTextBox is not rendered properly when it is added as a custom column filter through the "columns.filterable.ui" option.
### Reproduction of the problem
1. Use the "columns.filterable.ui" and define a JavaScript function which initializes a Kendo UI NumericTextBox;
2. Open the column filter menu and type in the input;
3. The entered value is not visible.
A Dojo sample for reproduction (filter column "Age"): https://dojo.telerik.com/OFuYawuC
### Expected/desired behavior
The NumericTextBox is wrapped in an additional "span" element with class "k-textbox". It should be removed.
### Environment
* **Kendo UI version: 2022.1.301
* **jQuery version: 1.12.4
* **Browser: [all]
Is it possible to implement an option for the Telerik UI for ASP.NET Core Grid to change the default filter operator "eq" to "contains" when the Grid column checkbox filter menu is enabled?
For example:
columns.Bound(p => p.ShipName)
.Filterable(ftb => ftb
.Multi(true)
.Search(true)
.Operators(op => op
.ForString(s => s
.Clear()
.Contains("Contains")
)));
//Filter expression:
filter: ShipName~contains~'test'
Hello Team Telerik,
we have a Grid with a Select column:
... .Columns(c => { c.Select().Width(50) ....
We want to give users the ability to quickly group rows that are selected. However, grouping the Grid by the Select() column is not possible
Is it possible to implement a method in the Read() configuration of the DataSource that will append parameters as name-value pairs to the query string?
For example:
.Read(r => r.URL(myUrlPath).Handler(myPageHandler).AddQryStrPairs(myNameValuePairsModel))
Currently, I am appending the parameters manually as follows:
.Read(r => r.Url(qurc.PageUrlPath
"?handler=Read&area=" + TkgrArea + "&serviceType=" + qurc.ServiceType.ToString() + "&serviceTag=" + qurc.ServiceTag + "&entityType=" + qurc.EntityType).Data("forgeryToken"))
### Bug report
The localization messages for some of the default Grid commands are missing. They are translated in the kendo.messages.he-IL.min.js:
https://github.com/telerik/kendo-ui-core/blob/master/src/messages/kendo.messages.he-IL.js#L302
### Reproduction of the problem
1) Create a Telerik UI Grid and enable the commands Edit(), Destory(), and Create().
2) Set the client-side culture to "he-IL" and register the localization script for that culture.
3) The commands are not translated.
Here is a Dojo sample, where all available localization messages for culture "he-IL" are in place:
https://dojo.telerik.com/UvaMivaS
### Expected/desired behavior
The localization messages from the "kendo.messages.he-IL.min.js" file should be available for the Telerik UI Grid.
### Environment
* **Kendo UI version: 2022.2.621
* **jQuery version: 1.12.4
* **Browser: [all]
### Bug report
When the Grid is grouped by a specified column, and this column has a "groupFooterTemplate" that contains aggregates from other fields, it cannot be exported to Excel. It throws a JavaScript exception.
### Reproduction of the problem
1) Group the Grid by the column "ProductName".
2) Export it to Excel through the built-in command "Export to Excel".
3) JS exception is thrown.
A Dojo sample for reproduction: https://dojo.telerik.com/UyUruyOZ
### Expected/desired behavior
The Excel export should work as expected when the Grid is grouped.
### Environment
* **Kendo UI version: 2022.2.802
* **jQuery version: 1.12.4
* **Browser: [all]
Grid's headers break upon ungrouping when the filterable mode is set to "row"
Upon ungrouping the Grid's headers are disrupted.
The Grid's headers should not be disrupted upon ungrouping.
When the Grid's PopUp Editing is enabled on mobile devices there are additional inputs or missing styling in the PopUp.
Note: The issue doesn't reproduce in a browser's DevTools on desktop
The PopUp is misaligned or its styles are missing on mobile devices