Is it possible to trigger an automatic page refresh (reload page), when a change to a wpdatatable row (edit or add) is saved or deleted?
I need because I would like to use wpdatatable as a datasource for another component on the same page, and the other component needs to be updated when data in table is changed.
I am sorry to disappoint you, but unfortunately something like this is not possible with the plugin's built-in features.
If you have a manual table, or a server-side SQL query based table, you do have an auto-refresh option above the table. You can add the interval (in seconds) after which the table will refresh itself, thus displaying any changes that happened in that time period.
Create a filter. Make sure that you choose "above the table". it is because we'll need the filter id for this trick.
jQuery("#filterBox_table_5").hide(); //if you don't want to see this filter, check your table id and use it here. jQuery("input[placeholder='YOUR FIELD NAME']").trigger('keyup'); // this refresh your table. Call this jQuery line each time you want to refresh it.
Hi,
Is it possible to trigger an automatic page refresh (reload page), when a change to a wpdatatable row (edit or add) is saved or deleted?
I need because I would like to use wpdatatable as a datasource for another component on the same page, and the other component needs to be updated when data in table is changed.
Thanks in advance :-)
All the best,
Jacob
Hello Jacob.
I am sorry to disappoint you, but unfortunately something like this is not possible with the plugin's built-in features.
If you have a manual table, or a server-side SQL query based table, you do have an auto-refresh option above the table. You can add the interval (in seconds) after which the table will refresh itself, thus displaying any changes that happened in that time period.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Jacob.
Sure you can do that with a little trick.
Create a filter. Make sure that you choose "above the table". it is because we'll need the filter id for this trick.
jQuery("#filterBox_table_5").hide(); //if you don't want to see this filter, check your table id and use it here.
jQuery("input[placeholder='YOUR FIELD NAME']").trigger('keyup'); // this refresh your table. Call this jQuery line each time you want to refresh it.
Any question let me know.
Regards
Alejandro
Hey @Alejandro,
thanks for this little trick, it really helped me a lot :)
If the target table is empty, the trick is not working. Do you know a workaround for that scenario? :)
Many thanks,
David
EDIT: Nevermind. I just catch the case when the table is empty and use a reload() via JS.