I have a function in a template to "reload" all the pocketquery macros existing in a page passing new parametters... the problem is that for some of them I have independent templates with some specific functions manipulating some data that are not working with this approach... Thus I intend to bypass that incorporating those functions in the "main" template of the page using the next code.... BUT... how can I identify a PocketQuery name of one of those macros in order to use some "IF" to manipulate ony the data of the macro that is focused???
Should it be something like IF Pocketquery ('index).name THEN xxxxxx but I do not arrive to find the good code to discriminate the macro that I have to manipulate...
I note hereafter part of the code of the function I use to reload the macros.
Any help will be welcome!
Thanks in advance!
_________
var newParameters = { ISDTI: jQuery('#select-isdti').val(),Type: jQuery('#select-type').val(),Annee: jQuery('#select-annee').val(),Mois: jQuery('#select-month').val(),Uno: 1 }; jQuery('.pocketquery-dynamic-load').each(function() { var container = jQuery(this); var dataIndex = container.data('index'); var data = PocketQuery.getDynamicLoadData(dataIndex); data.queryParameters = newParameters; PocketQuery.load({ container: container, data: data }); });
Hi Cuto!
If your macros are for different queries, you can simply target your containers like so:
jQuery('.pocketquery-dynamic-load[data-query="YourQueryName"]')
Then you don't need an each loop but you target every container you want to reload separately.
Regards, Felix
Is this also valid when the macro is not "dynamicload"? I try to apply this to one macro in a page that I use as a "basis" for filtering others being the other macros "dynamicload" and I find no way to update it with new parametters to be later used as filters...
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm. You want to update a PQ macro without dynamic load? You mean that this would refresh the page with dynamic parameters?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks again Felix!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.