Column Filter above Table header
-
Hello Tobias,
I love the work you did with TablePress. I would like a small tweak!
I downloaded and used this extension https://tablepress.org/extensions/datatables-column-filter/
I would love if can guide me how to move filter columns above Table Header!Best regards
-
Hi,
thanks for your question, and sorry for the trouble.
You could maybe try using this modified Shortcode parameter to move it to the header:
[table id=123 datatables_columnfilter="{sPlaceHolder:'head:after'}" /]
Regards,
TobiasHey Tobias,
Thank you for your feedback!
I did it but there is a conflict with the shorting of the table. When you click inside in order to type something, it also makes shorting.
I think it would be better if I can apply this functionality to the second row, in order for the first row (with the column headers) to use them only for shorting.Best regards,
AntoniosHi,
hhm, that’s strange. Not sure why that is ??
Unfortunately, I’m not really familiar with the JS code of this Extension so that I don’t know how to change this. Sorry.Regards,
TobiasInstead of change it, is any way either
1) to choose the second row as column filtering (I prefer this) or
2) the 1st row of the inserted CSV to be the second row at the front-end, in order for column filtering works smoothly?* One more question, i can insert a file with 10 columns, but to select which of them to be displayed at front?
Best regards
Hi,
unfortunately, as mentioned above, I’m not really familiar with the internals of this JS code (I only created the TablePress Extension out of it). You could maybe try checking the source code to see if it offers a way for choosing a different place.
For the second idea: That will not really work either, as you would still have problems with sorting, because it will still be the table header that is clickable.
For your third question: Do you mean columns or rows? Regardless, you could hide unwanted columns/rows on the “Edit” screen, by clicking the checkboxes on the left or below them and then use the “Selected columns/rows: Hide” button. Is that what you mean?
Regards,
TobiasI will give a try to check the code and I will let you now, if I will find something.
About the third question: I have not noticed it! Perfect!!!
Thank you very much Tobias!
Hi,
no problem, you are very welcome! ?? Good to hear that this helped!
Best wishes,
TobiasP.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Can I make two more question?
1) Let’s say that one of my hide columns is “products”, can i have a filter/search in order for filter my table based on this hide column?
2) There is any way to show the unique values of a column as drop-down menu? Do you know if there is any plugin that extends or works with yours like advanced search ?Thanks
Hi,
1) Yes, this is possible, but we will have to hide the column in a different way, namely via CSS code. For that, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress-id-123 .column-3 { display: none; }
(Just change the table ID and column number as necessary.)
2) For that, the TablePress Extension from https://tablepress.org/extensions/datatables-columnfilterwidgets/ should help.
Regards,
Tobiasooooh God, I definetely make a donation!!!!
So, can i exlude a few columns from this datatables_columnfilter=”{sPlaceHolder:’head:after’}” ?
Also, if I keep only sorting functionality, is any chance for sorting to be from A to Z based on the 1st column regardless of the order of the imported data?
I have only one notice to make. When I upload over 1000+ rows it’s a bit difficult to scroll up or down and to edit the table. It’s too slow! it has to do with my hosting or my wordpress installation?
Hi,
excluding columns from the Column Filter Extension is not possible directly (that’s only possible for the Column Filter *Widgets* Extension). The only way would be to again hide the input fields using CSS code, like
.tablepress-id-123 thead .column-3 input { display: none; }
To keep the first column sorted (with ranking numbers), you could take a look at the TablePress Extension from https://tablepress.org/extensions/datatables-counter-column/
Regarding the slowness of the “Edit” screen with large tables: Yeah, this is a known issue. Unfortunately, most browsers have problems managing the large number of input fields ?? Surprisingly, Internet Explorer/Edge are pretty good here, so you could maybe try that. Alternatively, the best workaround so far is to maintain/edit the table in e.g. Excel and then re-import it as a CSV file every time after making changes.
(I’m currently working on making all this better and faster, but that will still take time, because it’s not easy.)Regards,
TobiasHey Tobias, I will give a try.
Let’s say, I have these rows:
Business Product
Company1 Product1
Company1 Product2
Company2 Product1
Company2 Product2So, right now, I have hidden the column “Product”, but I am seeing all the rows. I am thinking to put one more column with a flag in order to hide “the duplicate rows” of column “Business”. Is this the right approach?
Or can i do with another way via Excel?
Best Regards
Hi,
interesting problem… I think the extra column might be the best approach, so that everything “unique”. You could also experiment with the TablePress Row Filter Extension from https://tablepress.org/extensions/row-filter/ maybe.
Regards,
TobiasI used an extra column like a flag and I used this excel function:
“If you want to identify 1st, 2nd, 3rd, etc. occurrences of each item, use the following formula: =COUNTIF($A$2:$A2, $A2)”
And i will try to hide everything except from the ones with “1” value at the column “flag”.
My problem now is that I cannot upload a file with 3000+ rows, I am getting http 500 error even if, i put these settings on my .htaccess
<IfModule mod_php5.c> php_value post_max_size 2000M php_value upload_max_filesize 2000M php_value max_execution_time 18000000 php_value session.gc_maxlifetime 1200 php_value memory_limit 512M </IfModule>
- The topic ‘Column Filter above Table header’ is closed to new replies.