Pagination in Pocket Query resultset?

Many a times result set is huge and increases the page length, did anybody try implementing the same?

4 answers

Hi Pranjal,

I had a check on this. It should be very straight-forward. I wouldn't use any library for this myself. This is my (MySQL) query:

SELECT Name, Population
FROM Country
WHERE Continent = :Continent
LIMIT :StartIndex,:PageSize

Important: this must be entered in the "Parameter Types" field: StartIndex=Integer&PageSize=Integer

In my macro, I checked the fields "Load macro dynamically", "Enable dynamic parameters" and "Use change params template". This is what I get:

image2016-9-20 11:33:10.png

With JS I can easily reload the macro for another start index:

(function() {
	var container = $('.pocketquery-dynamic-load[data-query="Pagination"]');
	var dataIndex ='index');
	var data = PocketQuery.getDynamicLoadData(dataIndex);
	data.queryParameters = { Continent: 'Europe', PageSize: 10, StartIndex: 30 };
			container: container,
			data: data

It's now very easy to build some HTML for the pagination menu. Just let me know if you need further help smile

Felix (Scandio)

Hi Pranjal! Haven't heard of anyone who did this yet. Nor have I tried myself. But the possibilities are there. You can write some JS in your template and use the PocketQuery.load method with a pagination parameter. Shouldn't be so difficult.

Felix, I did find something here but trying to figure out how can i implement it. I'll look into this later today and explore. If you can help me real quick, it'd be great.

Solution is interesting but in our case it would be more sufficient if there would be a possibility Pranjal Shukla described the way in Are there any further possibilities?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

879 views 2 13
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