This is a migrated thread and some comments may be shown as answers.

Filter Row Dropdown Suggestion Bug

3 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 17 Feb 2015, 09:54 AM
Hi,
when using kendo grid with filter in the headers and put the filter to filter in "contains" and not by "starts with" the dropdown suggestion goes always by "starts with".
I can consider this a bug, not a big deal but still it has raised bug tickets in our development environment and it seems something that could be fixable.

Example:
http://demos.telerik.com/kendo-ui/grid/filter-row

In "Ship Name" change the type of filter to "Contains" and start typing some text that would match that "contains" and not just "starts with".

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Feb 2015, 08:40 AM
Hello Brian,

The suggestions that are shown and the actual filtering perform on the Grid for that column use separate operators as explicitly highlighted in the documentation:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.operator

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.suggestionOperator

I will try to give a concrete example.
If the Grid has a column for products and the user wants to show all the products that are not equal to "foo". When the user has typed "f" he still would expect to see suggestion for "foo". This would not be possible if the suggestions are using the same operator used for filtering the Grid.

I hope this clarifies the case.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Udvikler
Top achievements
Rank 1
answered on 26 Nov 2019, 10:44 AM

Hi Petur,

 

I'm needing to change the "SuggestionOperator" of all the columns from my system.

I could do it individually as shown below:

cls.Bound(c => c.SKUDisplayName).Filterable(f => f.Cell(c => c.SuggestionOperator(FilterType.Contains)));

 

Is there any way to change the default value?

This is the method that I use to create my default grid:

 

  return gridBuilder
                .Name("LwKGrid" + gridName)
                .Reorderable(reorderable => reorderable.Columns(true))
                .Resizable(resizable => resizable.Columns(true))
                .ColumnMenu()
                .Groupable()
                .Sortable()
                .Filterable(filterable => filterable
                    .Mode(GridFilterMode.Row)
                    .Messages(m => m.IsFalse("No")).Messages(m => m.IsTrue("Yes"))
                    .Operators(o => o.ForString(s =>
                            s.Clear()
                            .Contains("Contains")
                            .DoesNotContain("Does not contain")
                            .IsEqualTo("Is equal to")
                            .IsNotEqualTo("Is not equal to")
                            .StartsWith("Starts with")
                            .EndsWith("Ends with")
                        )
                    ))
                .AutoBind(false)
                .Pageable(pg => pg.Refresh(true).PageSizes(new int[] { 150, 300, 600, 1000 }).ButtonCount(5))
                .Events(e => e
                    .Change("Grid_RowSelectedCheck")
                    .DataBound("Grid_DataBoundEvent")
                    .ColumnResize("SaveGridLatestStatus")
                    .ColumnShow("SaveGridLatestStatus")
                    .ColumnHide("SaveGridLatestStatus")
                    .ExcelExport("GridExcelExport"))
                ;

 

0
Ivan Danchev
Telerik team
answered on 28 Nov 2019, 08:32 AM

Hello ,

The approach you are already using is the proper way of setting the SuggestionOperator's default value. There is no other configuration option or method dedicated to changing its value.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Udvikler
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or