WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Simulteaneous row filtering and column hiding (10 posts)

  1. gregounours
    Member
    Posted 1 year ago #

    I am trying to maintain all my data in one table and only show what I need in different places but I can't seem to be able to filter rows and hide column using short codes at the same time. Has anybody had success with that?

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your post.

    Can you maybe post the URLs to these tables and what Shortcodes you used?

    Thanks,
    Tobias

  3. gregounours
    Member
    Posted 1 year ago #

    My bad it works actually.

    I had tried on my test instance on EC2 that I have since stopped. So I tried again on my production site and it actually works.

    This is amazing that way I can have all my data in one table and only show what I need. Now I have 2 follow up question:

    - Can I style differently the same table filtered differently on different pages through the shortcode (using class may be)

    - Can I query the content of one cell to display on a page. Is there anyway to invoke tablepress_cell_content inside a page to do that?

    Sorry not a coder here.

    Greg

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Greg,

    great to hear that it works :-)

    For your further questions:

    1. This is tricky, as all of these will have the same CSS classes (because they have the same table ID). Your best chance is probably to include a unique class that your theme gives to the <body> element. In most themes, you have something like "post-123" or "page-123" there. You could use that as a prefix to the actual table CSS. If your theme doesn't add this, you could wrap the Shortcodes in extra containers, like

    <div class="...">
    
    [table id=123 filter="..." hide_columns="..." /]
    
    </div>

    where you give a unique class to each <div> that you have there, and then use that as a prefix for the CSS selector.

    2.) So, you want to get just the content of a single cell? I did have some code for this for WP-Table Reloaded, but haven't yet had the time to create an Extension for this for TablePress. I'll add that to my TODO list though. Or if this is really urgent, please contact me via email (address is in the main plugin file "tablepress.php"). Maybe we can work something out.

    Regards,
    Tobias

  5. instantdecisif
    Member
    Posted 1 year ago #

    Hi Tobias,

    First of all: Tablepress is wonderful. Thanks for the work!!!

    I have the same question as the initial question of this topic:
    "I am trying to maintain all my data in one table and only show what I need in different places but I can't seem to be able to filter rows and hide column using short codes at the same time. Has anybody had success with that?"

    I can see that we can use filter parameter, but how does it work?

    Here is my table:
    http://www.lucilin.lu/demo/repertoire/

    Let's say I want to hide the 5th columns "Date", and show only the rows:
    - where 3rd column "Instrumentation" is not empty
    - where the hiden column "Date" is greater or equal to the date of today

    Thanks in advance for your help.

    Pierre

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Pierre,

    for the Filtering to work, you'll need to install and activate https://github.com/downloads/TobiasBg/TablePress-Extensions/tablepress-row-filter.zip as a regular WordPress plugin.
    Then, follow the instructions at http://tablepress.org/extensions/row-filter/ on how to use it.

    However, unfortunately, the filtering extension is not as powerful as you would like it. For example, having different criteria for different columns is not possible. Also, the filtering extension can only check for equality, but not for greater or smaller (like you want it for the date).

    Regards,
    Tobias

  7. mithun
    Member
    Posted 1 year ago #

    Hi Tobias,

    Sorry to keep troubling you.
    Please have a look at this website: http://rankings.ft.com/businessschoolrankings/executive-education-customised-2013

    In this site, you'll find a method to select two rows from the front-end. The row filter plugin allows this from backend. How could I simulate this from the front end?

    - Mithun

  8. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    are you refering to the checkboxes in the left column? You can add those manually by typing in the respective HTML code. You'll then however need some extra JS code to perform the desired action.
    TablePress does not have further support for this (like comparing rows), directly.

    Regards,
    Tobias

  9. solid7
    Member
    Posted 9 months ago #

    Forgive me for butting in, but I think I may have the same question. Same table used multiple places - I actually have it used in a sidebar widget - and because it needs to be more compact in size, I want to remove 2 columns, which have images. Is there an easy way to do this?

    Mind you, I would be using CSS outside of the tablepress plugin, using .mycustomclass .tablepress .

    Thanks in advance.

  10. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    thanks for your question.

    Removing columns (in the table in the sidebar) is pretty easy with an extra Shortcode parameter (that is explained in more detail in the TablePress Documentation at http://tablepress.org/documentation/ )
    Just extend the Shortcode like this:

    [table id=123 hide_columns="4,5" /]

    Regards,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic