I've a table with a hidden string field that can be a yes or no. I've done this as a 'defined values list'. Is there a way to do it as a checkbox / switch for a boolean?
Anyway the field is 'show column in front-end' set to false. I've set some conditional formatting rows to say if the value is yes then set the css for the row to a particular class, and if it is false to set the css to another class. This works okay if the 'show column in front-end' is on. However it doesn't work if it is set off.
Is there a way to make it work when the field is hidden?
Unfortunately when you use option hide on frontend, that column will not be avalible in DOM of html and that is reason why conditional formatting is not working on hidden columns. What you can do is to turn on this option and then add this code in Custom wpDataTables CSS under the "Custom JS AND CSS" in main settings of wpdatatables.
This will be affected on all tables, but if you want just for specific one then insert this code on page where is that table between the style tag.(<style>Code here</style>)
where class column-newcolumn is generated class depends of name of your column name. You can check from Inspect element of the browser how this class is looks like for that column that you need to hide and replace it with this one. Like this column will be available in DOM of html, but will be hidden for users and conditional formatting will work.
Milan, thanks I tried your review link, and I'm logged in, but I do not see a way to create a new review. I'm sure I'm being stupid but there isn't a button that is obvious to me, sorry Pete.
Hello,
I've a table with a hidden string field that can be a yes or no. I've done this as a 'defined values list'. Is there a way to do it as a checkbox / switch for a boolean?
Anyway the field is 'show column in front-end' set to false. I've set some conditional formatting rows to say if the value is yes then set the css for the row to a particular class, and if it is false to set the css to another class. This works okay if the 'show column in front-end' is on. However it doesn't work if it is set off.
Is there a way to make it work when the field is hidden?
kind regards
Pete.
Hi Pete,
Thank you for your purchase.
Unfortunately when you use option hide on frontend, that column will not be avalible in DOM of html and that is reason why conditional formatting is not working on hidden columns. What you can do is to turn on this option and then add this code in Custom wpDataTables CSS under the "Custom JS AND CSS" in main settings of wpdatatables.
This will be affected on all tables, but if you want just for specific one then insert this code on page where is that table between the style tag.(<style>Code here</style>)
where class column-newcolumn is generated class depends of name of your column name. You can check from Inspect element of the browser how this class is looks like for that column that you need to hide and replace it with this one. Like this column will be available in DOM of html, but will be hidden for users and conditional formatting will work.
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Milan, yes that worked great, many thanks for you assistance again, Pete.
Hi Pete,
You are welcome.
If you have any more issues or questions feel free to open a new ticket, we will gladly help.
We'd greatly appreciate it if you could take a minute and leave a Review on CodeCanyon on this link. Thanks!
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Milan, thanks I tried your review link, and I'm logged in, but I do not see a way to create a new review. I'm sure I'm being stupid but there isn't a button that is obvious to me, sorry Pete.
Hi Pete,
It is all right. We are here to help you.
You can take a look on this link how to leave a review on Envato market.
I am really grateful that you want to leave the review. It means a lot for us.
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables