[Resolved] Simulteaneous row filtering and column hiding
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?
thanks for your post.
Can you maybe post the URLs to these tables and what Shortcodes you used?
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.
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.
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:
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.
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).
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?
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.
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.
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" /]
- The topic ‘[Resolved] Simulteaneous row filtering and column hiding’ is closed to new replies.