I have been successful using the "pre-filtering a table using the URL." That works well, most of the time.
But, there are times when I have a very large table (SQL Server on Azure SQL) that has 250,000+ records, and the filter that I want to pass might bring in just 5 or 10 records.
So, if I could put the filter in the URL in the SQL query statement, that would be helpful.
But, it seems that this executes the full select * query, then applies the filter. I'd prefer to somehow include the filter in the select query to reduce traffic and speed up the query.
Is this possible?
Thank you for your help and your very useful add-in
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
I am honestly not 100% sure if i fully understood your use-case in full details, and if something like that is possible with the current capabilities of our plugin.
I will check with our 2nd level Team to get a second opinion and we will report back as soon as they respond.
I will also let you know if we need any further clarification from your end, or access.
The data pulled from the database creates a table using a query similar to this:
SELECT * FROM table WHERE value_x = %VAR1%
After that, you can use a hook for dynamic placeholders (place it in functions.php of your theme, or your child theme):
function updateVAR1($tableID){ global $wdtVar1; //check is set GET parametar value_x if(isset($_GET['value_x'])){ //get value from form field $wdtVar1 = $_GET['value_x']; } } add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');
I have been successful using the "pre-filtering a table using the URL." That works well, most of the time.
But, there are times when I have a very large table (SQL Server on Azure SQL) that has 250,000+ records, and the filter that I want to pass might bring in just 5 or 10 records.
So, if I could put the filter in the URL in the SQL query statement, that would be helpful.
So, for example, if my URL is https://mysite.com/listinvoices/?client=1234
It would be helpful if my query was
select * from invoices having client = %clientid% (or something like that).
So, if I could get the client id into a placeholder using $_get (or some similar function) that would be helpful.
Now, to be clear, I am able to get this result passing the query string using
https://mysite.com/listinvoices/?wdt_column_filter[clientid]=1234
But, it seems that this executes the full select * query, then applies the filter. I'd prefer to somehow include the filter in the select query to reduce traffic and speed up the query.
Is this possible?
Thank you for your help and your very useful add-in
Hi, John
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
I am honestly not 100% sure if i fully understood your use-case in full details, and if something like that is possible with the current capabilities of our plugin.
I will check with our 2nd level Team to get a second opinion and we will report back as soon as they respond.
I will also let you know if we need any further clarification from your end, or access.
Thank you for your patience.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
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, John
We got advised by our 2nd level Team. Here is what you can try.
Supposedly, let's say your URL is https://yourwebsite.com/?value_x=123
The data pulled from the database creates a table using a query similar to this:
After that, you can use a hook for dynamic placeholders (place it in functions.php of your theme, or your child theme):
I hope this helps.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
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
Miloš,
Thanks so much for this. I'll give it a try and let you know how it goes.
This looks like an ideal solution for me.
Again, I appreciate your kind help.
John
Hi, John
You're welcome.
Let us know how it goes when you try out the workaround idea.
We hope that it works, fingers crossed.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
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