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

Predefined filters

2 Answers 27 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
DavidOBrien
Top achievements
Rank 2
DavidOBrien asked on 21 Aug 2014, 09:15 PM
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 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 22 Aug 2014, 01:13 PM
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.
0
Petur Subev
Telerik team
answered on 25 Aug 2014, 11:55 AM
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!
 
Tags
Data Source
Asked by
DavidOBrien
Top achievements
Rank 2
Answers by
Andrew
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or