The FileManager has a toolbar with an inbuilt search text box. How can I change the filtering method from the default (seems to be "startswith") to "contains".
Thanks for any advice!
Patrick
2 Answers, 1 is accepted
1
Accepted
Neli
Telerik team
answered on 07 Jun 2021, 06:38 AM
Hello,
A possible approach is to define the search tool through the toolbar.items configuration, and change the operator in the toolbar.items.options to "contains":
I hope you will find the provided example helpful.
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
As it pertains to the 2022.2.802 build of the Kendo UI for MVC suite this is how I was able to accomplish the desired change to the doing contains given that the build in rendered search input element has a attribute value (data-command='SearchCommand') that can be used as a selector and has the filter criterion set as a data-options attribute out of the box thus it is simple matter to update the data-options attribute - verified it works in my implementation (added below js to script element on the Razor Index view hosting the FileManager control):
$(document).ready(function () {
var searchInput = $("[data-command='SearchCommand']");
if (searchInput) searchInput.attr("data-options", "{ \"field\": \"name\", \"operator\": \"contains\" }");
});
Neli
Telerik team
commented on 12 Sep 2022, 09:10 AM
Hi Michael,
Thank you so much for sharing your solution with the community. It is highly appreciated!
I believe it will be helping others facing the same scenario.