filtering by multiple search terms (solved)

filtering by multiple search terms (solved)

maxqjohnnymaxqjohnny Posts: 2Questions: 0Answers: 0
edited January 2011 in General
What I'm trying to do is, using checkboxes, filter through the results (kind of like istockphoto).

I have three columns in my documents table: name, type, and price. All of my checkboxes are of all the different document types. Here's the table:

[code]




Name
Type
Price





doc_1.doc
Bylaws
$4.99


doc_2.doc
Minutes
$3.49


doc_3.doc
Articles of Incorporation
$3.49




[/code]

So, when the user clicks the checkbox for "Articles of Incorporation" the table will be narrowed down to only rows with a type of "Articles of Incorporation". Then, if a user selects another checkbox, I'd like those rows to be shown as well. For example, if a user clicks the checkbox for "Articles of Incorporation" and checkbox for "Bylaws", all of the documents with a document type of "Articles of Incorporation" OR "Bylaws" will be shown.

Is this functionality possible?

Replies

  • maxqjohnnymaxqjohnny Posts: 2Questions: 0Answers: 0
    Nevermind, I figured it out by playing with this demo: http://datatables.net/examples/api/regex.html

    For anyone else who may be curious as to how this is accomplished, the js for doing what is described above is:

    [code]
    $('#documents_table').fnFilter('Articles of Incorporation|Bylaws', null, true, false);
    [/code]
This discussion has been closed.