Filtering on greater than/less than

Filtering on greater than/less than

DunhamzzzDunhamzzz Posts: 11Questions: 0Answers: 0
edited November 2009 in Plug-ins
Right I thought I'd ask here first to potentially save me the hassle of making this sort of plugin myself,

Basically I'd like to filter the table on a certain column (my price column) so that users can effectively select what their budget is. ie They select a max price of $500, everything with more than 500 in the price column gets filtered

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Hi Dunhamzzz,

    Assuming you are using client-side processing, then you can use something very similar to http://datatables.net/examples/api/range_filtering.html (just take off the min...). If you are using server-side processing, then you'll need to modify your SQL to match the query as required.

    Hope that helps,
    Allan
  • giorgio79giorgio79 Posts: 43Questions: 0Answers: 0
    This was moved here :)
    http://datatables.net/examples/plug-ins/range_filtering.html
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Thanks for the pick up! I've just added a 301 redirect.

    Allan
  • tapsboytapsboy Posts: 11Questions: 0Answers: 0
    Is there a preferred way of sending this info to the server, so that I can handle the range filter on server-side?

    I am already sending the filter text like this:
    oSettings.aoPreSearchCols[colToFilter].sSearch = value;

    Is there a pre-defined variable inside oSettings, which can hold the filter operation information passed to the server or should I insert my own?

    Something like:
    oSettings.aoPreSearchCols[colToFilter].sSearchOperation = 'lt'; // lt, gt, le, ge, cn, before, after, etc go here as values
This discussion has been closed.