Pocket Query: Is there a way to disable automatic query execution when the page is loaded?

  1. Whenever we load a PQ page, the query is automatically being run. Is there any way to disable this? We would like to have empty parameters for the user to specify to do query searches. This is something that we would not like to hard code/ specify but much rather leave blank for the user to input.

2 answers

Hi Lawrence,

Very good point, I'm wondering why I didn't come up with this idea on my own. So thanks at the first place. I put this on the list of features for PocketQuery 2.1 which we plan to released in late February.

If this is important for you, I could provide you a workaround until now. Question: do you only have one PocketQuery or multiple in your page? Could you paste me the storage format of the page?

Regards, Felix

Hey Felix,

Thanks for letting me know. I would love a work around. This would possibly be for a single and/or multiple PQs on the page.

Storage format:

<p>&nbsp;</p>
<p><ac:structured-macro ac:macro-id="de1923b2-922c-483e-b68a-d9f4d674115e" ac:name="pocketquery" ac:schema-version="1"><ac:parameter ac:name="name">MOATEnable</ac:parameter><ac:parameter ac:name="dynamicload">true</ac:parameter><ac:parameter ac:name="includereloadbutton">true</ac:parameter><ac:parameter ac:name="includechangetemplate">true</ac:parameter><ac:parameter ac:name="parameters">partnerid=4&amp;ToC=4</ac:parameter><ac:parameter ac:name="allowgetparams">true</ac:parameter></ac:structured-macro></p>

thanks,

Lawrence

Hey @Felix Grund (Scandio), just checking up to see if you were able to get a workaround for this, thanks

Hi Lawrence,

You could try the following as a temporary workaround.

Enter this code at ConfluenceAdmin > Custom HTML > At end of the BODY:

&lt;script&gt;
(function($) {
	var QUERY_NAME = 'yourQueryName';
	var dynamicLoadClass = 'pocketquery-dynamic-load';
	var $container = $('.'+dynamicLoadClass+'[data-query="'+QUERY_NAME+'"]');
	$container.removeClass(dynamicLoadClass);
	AJS.toInit(function() {
		$container.addClass(dynamicLoadClass);
	});
}(jQuery));
&lt;/script&gt;

In the code, replace yourQueryName with the name of your query.

Works for me with PocketQuery 2.0.3. We'll add a proper feature for this soon, somehow.

Let me know if this works!

Regards, Felix (Scandio)

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

359 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you