PocketQuery and SQLforConfluence


I have 2 the same sql query with columns: ID, Summary, Desc

In PocketQuery, data is displayed with the same column width. But, In SQLForConfluence - columns of different widths.

So, In desc columns I see all the text. 

Could you help me please, is it real in PocketQuery?

1 answer

1 accepted

1 vote
Answer accepted

Hi Artashes,

you can make it possible for the user to change the column width by setting the parameter colresizable:true for the template in question. Then the column widths can be adjusted by draging the borders, so the full content becomes visible. Is this what you have in mind?

This minimalistic template simply adds the resizing function to the default template:

## @param colresizable:true

"Load macro dynamically" has to be disabled for this to work, that's a known issue we will take care of.

Does this solve your problem? Let me know if you need further help.



Carla Hi!

thx for your reply. Could you tell me please, where is the default template?

If you add a new Query in the PocketQuery administration, you can set a template that is used for displaying it. Among the choices you will always find a template called "default" that is a simple table.

Have you already had a look at the templating section in the PocketQuery Documentation (the very last tab)? You will find lots of information there, including the source code of the default template (in case you want to further adjust it).

The code snippet I gave you above is also a complete and working template. Simply add it as a new template in the PocketQuery administration with a reasonable name and you can select it for your queries.

The templates are quite powerful. It's really worth having a closer look at that feature smile

You are not understood smile

So, what I do:


I added new template with code default from your site

<table class="pocketquery-table confluenceTable">
  #foreach ($column in $columns)
    <th class="col-$velocityCount">$!column</th>
  #foreach ($row in $result)
    <tr class="#if($velocityCount % 2 !=
    #foreach ($column in $row)
      <td class="col-$velocityCount">$!column</td>


Then, I need to add your code(parametr) above. Where?

Ah, you already have your template smile

Then just add the parameter at the very beginning:

## @param colresizable:true
<table class="pocketquery-table confluenceTable">
  #foreach ($column in $columns)
    <th class="col-$velocityCount">$!column</th>

oookey, but it doesn't work.

Columns the same.

They are initially the same width, but they should be adjustable if you grab the border between two of them with the mouse and move it. Is that not possible?

Hm, could you doublecheck if the option "Load macro dynamically" is disabled? And if this query really does not use the default template anymore but your new customized one?

No, it's not possible.

Option - "load macro dynamically" is disabled. I can sort by column only.

Carla, I resolved.

So. it does not work, if the macros PQ is macros Expand. If macros on page - grab the border works. But after F5 everything returns to its original position. Can we fix columns such as SQLForConfluence?

Interesting behavior with the expend macro, thanks for pointing it out to us!

I just had a closer look at the SQL for Confluence plugin and their table layout. The following template turned out similar for me, please try it out:

<table class="confluenceTable stickyTableHeaders"><tbody>
#foreach ($column in $columns)
    <th class="confluenceTh">$!column</th>
  #foreach ($row in $result)
    #foreach ($column in $row)
      <td class="confluenceTd">$!column</td>

Yes Yes Yes, this is what i need.

I wonna be coders such as you :) What am I should to know?

Thx you very much.

Glad I was able to help smile 

Have fun exploring the possiblities of PocketQuery!

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...

358 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