Hello,
i'm using MVC5 Razor helper to create grid and i'm trying to show specific autocomplete values in filter row. As i undestood it from forums and docs i have to replace standard filter row input by manually creating kendoAutoComplete(...) with my own dataSource, as shown for example here with classic filter menu:
https://demos.telerik.com/aspnet-mvc/grid/filter-menu-customization
or here with filter row:
https://www.telerik.com/forums/server-side-filtering-with-row-filter-mode-filters-too-soon!
My custom JS autocomplete:
<script>
function onFilterAutocomplete(e)
{
e.element.kendoAutoComplete({
filter: 'contains',
dataSource: {
serverFiltering: true,
serverSorting: true,
transport: {
read: '@Url.Action("FilterAutocompleteAsync")'
}
}
});
}
</script>
My server method:
[HttpPost]
//[ValidateAntiForgeryToken]
public async Task<JsonResult> FilterAutocompleteAsync([DataSourceRequest]DataSourceRequest dataSourceRequest) => Json(/*... db stuff...*/);
When i try to replace input by defining:
columns.Bound(x => x.ColumnName).Filterable(x => x.Cell(y => y.Template("onFilterAutocomplete")));
my JS function is executed on grid init and no errors are shown in browser console. But when i try to filter, the automatic autocomplete on filter input keeps showing values as normaly from grid dataSource (standard behaviour) and my controller method won't get called.
If i try to replace input by defining:
columns.Bound(x => x.ColumnName).Filterable(x => x.UI("onFilterAutocomplete")));
my JS function won't get called at all.
What am i doing wrong here?
PS: I've tried with following versions:
telerik.ui.for.aspnetmvc.hotfix.2019.2.619.commercial.digitally-signed
and
telerik.ui.for.aspnetmvc.hotfix.2021.2.511.commercial.digitally-signed
placeholder: '~test~'
attribute to kendoAutoComplete init object and after grid init, no placeholder can be found in the filter row column input, so that custom autoComplete won't get created ever, not even with the Template.