Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to identify a pocketquery macro of a page in a template?

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
    });
});

 

 

3 answers

1 accepted

0 votes
Answer accepted

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

Many thanks again 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!

Hmm. You want to update a PQ macro without dynamic load? You mean that this would refresh the page with dynamic parameters?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

852 views 8 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you