WordPress.org

Ready to get started?Download WordPress

Forums

WP-Table Reloaded
[resolved] Filter/Search numbers in column equal to or greater than (2 posts)

  1. thefractalwarrior
    Member
    Posted 1 year ago #

    Hi Tobias

    Firstly, thank you very much for a truly useful plugin.

    I have a website on a test site here: http://marcusmercer.com/stuletsgildup/ that uses WP Table Reloaded for showing available houses to students, I've followed your instruction and got the search box to filter only the 'Rooms Available' column where the students only have to enter the number of rooms required and houses with that number are shown - but if say 2 people wanted a room each, no result would be returned although they would be accommodated by a 3 or more bedroom house, (they may leave the site and go elsewhere, if they see nothing available).

    Is there a way to show rows with 2 or more rooms available etc. by just using the search/filter box?

    I've added an interim solution by replacing 'No matching records found' with a more helpful result in this context.

    Many thanks in advance for your help.

    Marcus

    http://wordpress.org/extend/plugins/wp-table-reloaded/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Marcus,

    thanks for your question.

    I see what you mean, but I can't really think of an easy solution right now :-( The reason is the way how the DataTables JS library (which does this search) works. It just looks for matches of the search word in the cells, but doesn't do smaller or greater comparisions.
    Unfortunately, as I'm not the developer of that JS library, but only use it with WP-Table Reloaded, I'm not aware of a way to alter this behavior.
    Instead of using the search feature, it might be worth a try to develop as custom script that maybe adds a drop down list, where the visitor selects the number of rooms, and which then applies some custom JS code to find the corresponding rows. This might be possible by using the DataTables API (see http://www.datatables.net). As I can't really help with that, you might want to ask in the DataTables forums on their website.

    Regards,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic