WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Search A Column Not The Whole Table (13 posts)

  1. Neil Haslewood
    Member
    Posted 10 months ago #

    Hi Tobias

    Is it possible to search a column rather than the whole table. In other words I want to see the results from just a predefined column when I type in character by character as you would when typing into the default search box?

    Thank you.

    Kind Regards

    Neil

    http://wordpress.org/plugins/tablepress/

  2. Haoxian
    Member
    Posted 10 months ago #

    Hi Neil,

    Please read this post to see if that is you wanted:
    http://wordpress.org/support/topic/search-a-single-column

    Regards,
    Haoxian

  3. Neil Haslewood
    Member
    Posted 10 months ago #

    Hi Haoxian

    Thank you for your response.

    It looks like my best option would be to download and install the TablePress Column Filter Extension. I will try this out when I get home this evening.

    Regards
    Neil

  4. Haoxian
    Member
    Posted 10 months ago #

    Hi Neil,

    No problem. Please let us know whether it works like you expecting.

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

    Best wishes,
    Haoxian

  5. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    yes, you could either use the Column Filter Extension from http://tablepress.org/extensions/datatables-column-filter/ or - if you only want the one Search field that is shown to be restricted to one column - add that "Custom Command" that is mentioned in the link that Haoxian posted.

    Regards,
    Tobias

  6. Neil Haslewood
    Member
    Posted 10 months ago #

    Hi Tobias

    I have installed and activated the Column Filter Extension and also changed two pages with [table id=xx datatables_columnfilter="true" /] where xx = the table number but when I view the webpage nothing has changed!

    Do you have any ideas why this is not working?

    Regards
    Neil

  7. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Neil,

    could you please post the link to the page with the table where this is not working? Thanks!

    Regards,
    Tobias

  8. Neil Haslewood
    Member
    Posted 10 months ago #

  9. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Neil,

    thanks for the links.
    From what I can see, your table's do not have a Table Footer row. However, the Column Filter JS code requires that, as that's where it will put the search fields. So, please add a new and empty last row to those tables and activate the "Table Footer" checkbox.

    Regards,
    Tobias

  10. Neil Haslewood
    Member
    Posted 10 months ago #

    Hi Tobias

    Sorry ... just one last point. Is it possible to have the column search boxes at the top of the table? The reason for asking is because when you enter data into the search box and if the results are few the screen remains where it is in the page and then the results are hidden from view further up the screen. I hope I have explained that well enough for you.

    Regards
    Neil

  11. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Neil,

    unfortunately, I'm not aware of a direct possibility for that :-( Sorry. I guess, having them in the header row interferes with the sorting, which could be why this is not implemented in the JS code.
    You'll therefore most likely need to develop a custom solution with custom search fields, using the DataTables API :-(

    Regards,
    Tobias

  12. Neil Haslewood
    Member
    Posted 10 months ago #

    Hi Tobias

    Just to add that I have updated the table with the custom search fields using the DataTables API and all is working well.

    Thank you

    Regards
    Neil

  13. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Neil,

    very nice! Good to hear that this helped!

    Best wishes,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic

Tags