Predefined filters

3 posts, 0 answers
  1. DavidOBrien
    DavidOBrien avatar
    14 posts
    Member since:
    Sep 2012

    Posted 21 Aug 2014 Link to this post

    so lets say that 

    1.grid.dataSource.filter({
    2. logic: "and" ,
    3. filters: [
    4.    { field: "UserDeviceCount", operator: "gt", value: 1 },
    5.     { field: "EmailSent", operator: "neq", value: 1 },
    6. ]
    7.});

    is equivalent to

    1.select * from grid where userdevicecount > 1 and emailsent <> 1
     
    How would I write this?

    1.select * from grid where userdevicecount = 1 and ( remoteuse > 90 or officeuse > 90 or unknownuse > 90 )
  2. Andrew
    Andrew avatar
    19 posts
    Member since:
    Jan 2013

    Posted 22 Aug 2014 in reply to DavidOBrien Link to this post

    I haven't tried this, but the docs say filters can be nested, so maybe you could do:
    grid.dataSource.filter({
        logic: "and" ,
        filters: [
            { field: "UserDeviceCount", operator: "eq", value: 1 },
            {
                logic: "or",
                filters: [
                    { field: "remoteUse", operator: "gt", value: 90},
                    { field: "officeUse", operator: "gt", value: 90},
                    { field: "unknownUse", operator: "gt", value: 90},
                ]
            },
        ]
    });

    It would be great if you could write "grid.filter(function (row) { return row.foo == 1 && row.bar < 12; })", but I'm not sure if Kendo grids have anything like that.
  3. Kendo UI is VS 2017 Ready
  4. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 25 Aug 2014 Link to this post

    Hello Guys,

    Please notice the filter operator might be a functions and thus clientside filtering could be manually handled:

    http://www.telerik.com/forums/custom-filtering-7b617857877c#prkw13DE9E2pMvYMcx-6Hg

    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!
     
Back to Top