Hi.
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?
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 $PocketQuery.template("default")
"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.
Regards,
Carla
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are not understood
So, what I do:
I added new template with code default from your site
<table class="pocketquery-table confluenceTable"> <tr> #foreach ($column in $columns) <th class="col-$velocityCount">$!column</th> #end </tr> #foreach ($row in $result) <tr class="#if($velocityCount % 2 != 0)odd#{else}even#end"> #foreach ($column in $row) <td class="col-$velocityCount">$!column</td> #end </tr> #end </table>
Then, I need to add your code(parametr) above. Where?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, you already have your template
Then just add the parameter at the very beginning:
## @param colresizable:true <table class="pocketquery-table confluenceTable"> <tr> #foreach ($column in $columns) <th class="col-$velocityCount">$!column</th> (...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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> <tr> #foreach ($column in $columns) <th class="confluenceTh">$!column</th> #end </tr> #foreach ($row in $result) <tr"> #foreach ($column in $row) <td class="confluenceTd">$!column</td> #end </tr> #end </tbody> <table>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I was able to help
Have fun exploring the possiblities of PocketQuery!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.