Grid multiple values

3 posts, 0 answers
  1. Tom
    Tom avatar
    7 posts
    Member since:
    Jan 2014

    Posted 21 Jul Link to this post

    I have a grid and I am trying to filter on multiple values:
    FirstName, LastName or FirstName + " " + LastName

    So the user can search for:
    "John"
    "Smith"
    "John Smith"

     

    Currently I have:

    grid.dataSource.filter({
        logic: "or",
        filters: [
            { field: "FirstName", operator: "contains", value: value },
            { field: "LastName", operator: "contains", value: value },
            { field: "MemberID", operator: "equals", value: value },
            { field: "JobTitle", operator: "contains", value: value },
     
                {
                    logic: "and",
                    filters: [
                        { field: "FirstName", operator: "equals", value: value },
                        { field: "LastName", operator: "equals", value: value }
                    ]
                }
     
        ]
    });

     

    The search for "John" or "Smith" works however not on "John Smith"

    Any ideas
    Thanks

    Tom

     

     

  2. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 25 Jul Link to this post

    Hello Tom,

    In order to support such functionality you will need to split the value and create filter expressions which to filter on the individual values.

    Another approach will be to use a custom filter function to concatenate the fields' value and  filter on the result.

    Here is a basic implementation of both approaches. 

    Regards,
    Rosen
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Tom
    Tom avatar
    7 posts
    Member since:
    Jan 2014

    Posted 25 Jul Link to this post

    Thanks Rosen for the example.

    There is also a good example here: http://www.telerik.com/forums/grid-search-feature#hajM7dAms0KgZi2jeCl6eA 

    For anyone else with this issue.

Back to Top