I have a Table A and I want to be able to click a row or button to load Table B (on another page with Table B) using a value from Table A as part of the SQL Query on Table B. For example: Click on row for User ID 1234 and show all User ID 1234 results on Table B.
Well we dont have this built in function, but you can try next but you will need some experiance with writing SQL queries and using WP hooks.
You can create table with 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 shortcode of the tableid that you need with placeholder like this
[wpdatatable id=1 var1=1]
of course, you will create that second table from query like
SELECT * FROM second_table WHERE user_id = %VAR1%
and then you will use our hook for dynamic upsetting placeholders
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 result like you need
You will insert in functions.php of your theme or your child theme depends on what you are using. IF you are using child theme then this code will not be deleted after theme update.
There is no embarrassing or stupid questions. Every day we are learning something new and that is not embarrassing.
If you have any other issue or question please open new ticket, and we help you out.
I’d like to ask you a favor. Would you mind taking a few minutes to write a review for us, please on this link?
Our free version is the only place where we can have proof for our hard work; your comments are beneficial for others to know what to expect when they’re looking for our plugin.
Thank you in advance. It means a lot to us, and I am looking forward to reading your comment.
Hi,
I have a Table A and I want to be able to click a row or button to load Table B (on another page with Table B) using a value from Table A as part of the SQL Query on Table B. For example: Click on row for User ID 1234 and show all User ID 1234 results on Table B.
Is this possible?
Best regards,
Paul Williams
Hi Paul,
Thank you for your purchase.
Well we dont have this built in function, but you can try next but you will need some experiance with writing SQL queries and using WP hooks.
You can create table with query for example
and then on your_custom_page you will insert shortcode of the tableid that you need with placeholder like this
[wpdatatable id=1 var1=1]
of course, you will create that second table from query like
SELECT * FROM second_table WHERE user_id = %VAR1%
and then you will use our hook for dynamic upsetting placeholders
Like this I believe you will get result like you need
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
Thanks Milan - just what I was looking for. I will give it go.
Best regards,
Paul.
Hi Paul,
You are welcome.
Let me know when you finish this, is that what you're looking for.
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
Hi Milan,
Forgive me for being an idiot but is the 'hook' code you provided Javascript or PHP and where should it be placed?
Hi Paul,
You will insert in functions.php of your theme or your child theme depends on what you are using. IF you are using child theme then this code will not be deleted after theme update.
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
Thanks for your very quick response Milan - great support!
Sorry for the embarrassing question!
Best regards,
Paul.
Hi Paul,
You are welcome.
There is no embarrassing or stupid questions. Every day we are learning something new and that is not embarrassing.
If you have any other issue or question please open new ticket, and we help you out.
I’d like to ask you a favor. Would you mind taking a few minutes to write a review for us, please on this link?
Our free version is the only place where we can have proof for our hard work; your comments are beneficial for others to know what to expect when they’re looking for our plugin.
Thank you in advance. It means a lot to us, and I am looking forward to reading your comment.
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
Thanks Milan - will do.
Best regards,
Paul.