I have some data in one table and would like to open another table on another page based on the value I'm clicking.
To try to be more precise, I would like to open a table: by clicking on the value present in a cell, for example an id, I would like to open a table referring to that value.
Thank you for your purchase Sorry for the delay in our responses, has been national holidays in our country for the last two days.
Well we don't have this built-in function, but you can try it next but you will need some experience with writing SQL queries and using WP hooks.
You can create a table with a query for example
SELECT
user_id,
user_name,
user_address,
CONCAT('<a href="http:/yoursite.com/your_custom_page?user_id=',user_id,'">Details</a>') AS Details
FROM your_table_name
and then on your_custom_page, you will insert a shortcode of the tableID that you need with a placeholder like this
[wpdatatable id=1 var1=1]
of course, you will create that second table from a query like
SELECT * FROM second_table WHERE user_id = %VAR1%
and then you will use our hook for dynamic upsetting placeholders(you will insert this in functions.php file of your theme or child theme)
function updateVAR1($tableID){
global $wdtVar1;
//check is set GET parametar user_id
if(isset($_GET['user_id'])){
//get value from form fieald
$wdtVar1 = $_GET['user_id'];
}
}
add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');
Like this, I believe you will get a result as you need
If you don't have an SQL table, then there is also a workaround but with our add-on Master-detail and some hooks.
Hello,
I have some data in one table and would like to open another table on another page based on the value I'm clicking. To try to be more precise, I would like to open a table: by clicking on the value present in a cell, for example an id, I would like to open a table referring to that value.
Hi Marco,
Thank you for your purchase
Sorry for the delay in our responses, has been national holidays in our country for the last two days.
Well we don't have this built-in function, but you can try it next but you will need some experience with writing SQL queries and using WP hooks.
You can create a table with a query for example
and then on your_custom_page, you will insert a shortcode of the tableID that you need with a placeholder like this
[wpdatatable id=1 var1=1]
of course, you will create that second table from a query like
SELECT * FROM second_table WHERE user_id = %VAR1%
and then you will use our hook for dynamic upsetting placeholders(you will insert this in functions.php file of your theme or child theme)
Like this, I believe you will get a result as you need
If you don't have an SQL table, then there is also a workaround but with our add-on Master-detail and some hooks.
Let me know if you are interested in this.
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