Grid SuggestionsOperator not showing correct results when initially filtering the datasource...

5 posts, 0 answers
  1. Paul
    Paul avatar
    6 posts
    Member since:
    Dec 2015

    Posted 07 Jun 2019 Link to this post

    I have created a grid to show a list of employees. The grid columns are filterable and I have set an initial IsLeaver filter on the data source to only show non-leavers. The problem I have is the suggestion operator is not initially showing all the results I would expect.

    For example "LocationA" does not show up as a suggestion when initially trying to type this into the location filter. However, when I press enter their are lots of rows with "LocationA" that show up in the grid.  I am using "contains" for both the operator and suggestion operator so they should be the same.

    If I clear the IsLeaver filter in the browser and then set it back to the same value then "LocationA" will start appearing in the suggestions operator.

    If I do not set an initial IsLeaver filter and just set the filter in the browser then "LocationA" correctly appears in the suggestions operator.

    @(Html.Kendo().Grid(Model)
     .Name("EmployeeDataGrid")
     .Columns(columns =>
     {
        columns.Bound(p => p.ID).Filterable(f => f.Cell(c => c.ShowOperators(false).Operator("contains").SuggestionOperator(FilterType.Contains)));
        columns.Bound(p => p.Name).Filterable(f => f.Cell(c => c.ShowOperators(false).Operator("contains").SuggestionOperator(FilterType.Contains)));
        columns.Bound(p => p.Location).Filterable(f => f.Cell(c => c.ShowOperators(false).Operatord("contains").SuggestionOperator(FilterType.Contains)));
        columns.Bound(p => p.IsLeaver);
    })
    .Pageable()
    .Sortable()
    .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
        .Filter(f => f.Add(p => p.IsLeaver).IsEqualTo(false))))

     

    Any suggestions as to why "LocationA" is not initially showing up in suggestion operator when there are definitely rows for "LocationA" that are not leavers. I can see these rows when I apply the filter so I can't understand why "LocationA" does not appear in the suggestion operator. 

  2. Paul
    Paul avatar
    6 posts
    Member since:
    Dec 2015

    Posted 07 Jun 2019 in reply to Paul Link to this post

    Forgot to say that I am using Kendo MVC 2018.3.1017.545.
  3. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2497 posts

    Posted 11 Jun 2019 Link to this post

    Hello Paul,

    I examined the code and noticed that there was a typo in the configuration of the Location column. Please remove the extra "d" from the Operators option and see how that affects the behavior.

    columns.Bound(p => p.Location).Filterable(f => f.Cell(c => c.ShowOperators(false).Operatord("contains").SuggestionOperator(FilterType.Contains)));

    With that said, I tested the behavior with our online example and the suggestions were displayed as expected on my end. Please check out the short video below and let me know if I am missing something:


    Also, would you update the components to the latest release and see if the issue is still observed. If it is please send us a runnable sample where the behavior is replicated so we can examine it. 

    Regards,
    Viktor Tachev
    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.
  4. Paul
    Paul avatar
    6 posts
    Member since:
    Dec 2015

    Posted 11 Jun 2019 Link to this post

    The d was just a typo when I was trying to post the forum topic... I couldn't see how to update the original post to remove it.

    I looked through the release notes and couldn't see anything that would indicate this has been fixed in a later version.  I can try and upgrade, but it will take me some time to do this and was hoping to avoid this if possible.

    I'll see about getting this done if you don't have any other suggestions and the code above (with exception of the 'd') looks ok to you.

     

     

  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2497 posts

    Posted 13 Jun 2019 Link to this post

    Hi Paul,

    Another thing I can suggest trying is binding the Grid using Ajax binding. Instead of passing the Model directly to the Grid specify only the type and configure the Read Action for the DataSource to request the data. Like in the Binding to remote data example.

    In case the behavior persists please send us a runnable project where it is replicated so we can examine it locally.


    Regards,
    Viktor Tachev
    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.
Back to Top