How to change Column string search functionality from startsWith to any other value

0 Answers 73 Views
Grid
Daniel
Top achievements
Rank 2
Iron
Iron
Daniel asked on 10 Jul 2023, 08:16 AM

Hello,

We are using kendo vue native component Grid.

FilWe do have column filtration. We noticed that when we filter a column with string values from column filter, the search that is being done, is a startsWith. For our business purposes we want to change startsWith to Contains for example. 

Is there a clean way of doing this? Do you have any suggestions or examples?

Thanks

Petar
Telerik team
commented on 13 Jul 2023, 07:55 AM

Hello, Daniel. 

Can you please specify if you are using row or column filtering in your scenario? In these examples, you can see that both scenarios have the option to select how the filtering will be done.  

Having the above, I would assume that you are using a custom scenario in your application. Can you please share more details about the filtering logic that you use? Are there any customizations applied in the Grid you use? 

 

Daniel
Top achievements
Rank 2
Iron
Iron
commented on 13 Jul 2023, 08:04 AM

Hello Petar,

We do have a custom scenario but I don't think that it affects what we are trying to understand here. We are using a column filtering. Can you please provide an example of how to alter the functionality of how the filtering will be done?

Thanks!

Petar
Telerik team
commented on 17 Jul 2023, 03:19 PM

Hello, Daniel.

Here is a StackBlitz example demonstrating how we can have an input inside the column menu of the Grid which filters the component's data using the "contains" operator.

Please check the shared example and let me know if you have questions about its implementation.

Daniel
Top achievements
Rank 2
Iron
Iron
commented on 18 Jul 2023, 08:31 AM

Hello Petar,

Well, this is a solution that we thought about it already and we don't like it so much, hence we asked this question. Wouldn't it be a better solution provide an API for the prop for each column? Would this be possible to implement in future releases?

Petar
Telerik team
commented on 18 Jul 2023, 11:51 AM

Hello, Daniel. 

I can agree with you that having API configuration can that controls the customization of the Grid's column menu is something that will improve the work with the component and make its configuration easier. 

Just to be on the same page, and because I don't know your specific custom scenario, may I ask you to share what do you think the users should be able to configure through the API? What I mean here is that usually, the column menu filter has a dropdown from which one can choose a filter operator. In addition, by default, there are two inputs that can be used for filtering. 

Based on the requested above details we will log a feature request on your behalf about providing API that can configure the column menu filtering.

Looking forward to your reply.

Daniel
Top achievements
Rank 2
Iron
Iron
commented on 02 Aug 2023, 07:36 AM

Hello Petar, 

I discussed with the team some ideas. And they came back with the below scenario and proposal:

When I activate the searchbox inside the GridColumnMenuCheckboxFilter,
on typeahead i want items collection that is rendered by the GridColumnMenuCheckboxFilter component
to be filtered with 'contains' operator and not with 'StartshWith' Is there a way to accomplish this?

Our proposal: in GridColumnMenuCheckboxFilterProps include one more prop (ex serchBoxOperator) that can take a
FilterOperator (e.x { text: "Contains", operator: "contains" }) to work with. Same goes for the GridColumnMenuFilter.

Petar
Telerik team
commented on 07 Aug 2023, 07:04 AM

Hello, Daniel. 

Thank you for the shared feedback. Based on it, I've logged this Feature request on your behalf about providing a property that can control the filter operator of the input in the GridColumnMenuCheckboxFilter. I cannot say exactly when the feature will be implemented but I would say that it won't take us long to provide the requested configuration. 

Please let me know if you have additional questions or need furhter assistance with the current ticket.

Looking forward to your reply.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Daniel
Top achievements
Rank 2
Iron
Iron
Share this question
or