Ajax DataGrid Support Product Page

Define Multiple custom filters

Asked 31 Mar 2012 08:06:30
1
has this question
31 Mar 2012 08:06:30 Tim Hodge posted:
How to use multiple custom filters?

Just like when you define a Recorset with multiple WHERE clauses, How can you define multiple "filters" within DataGrid?

Here's a Recordset example:
From table "client" I want to select where category=1 and st does NOT = either CA or CO.

SQL would be...
SELECT * FROM client WHERE client.category = 1 AND client.st != 'CA' AND client.st !='CO'

Can this be done within DatGrid?
Or can I get DataGrid to use my defined Recorset for the page? This would be even better for my purposes.

Filter definition in DataGrid does not allow operators such as NOT EQUAL.

Also... Any examples on how to use DataGrid filters Session Variables, Server Variables or Request Variables? I'm missing something here. Thank you.

Replies

Replied 01 Apr 2012 13:25:06
01 Apr 2012 13:25:06 Tim Hodge replied:
Discovered easy solution...
Use MySQL's VIEWs. Here's the SQL...

CREATE VIEW SalesNotCACO AS
SELECT * FROM client WHERE client.category = 1 AND client.st != 'CA' AND client.st !='CO;


The above VIEW return sales report for Category 1 that is also NOT in CA or CO.

In DataGrid, just select the VIEW as you would have selected a Table in your database.

Reply to this topic