Page 1 of 1

Set {workitems} table column width

Posted: Mon Jan 23, 2012 9:45 am
by Spring
Hello,

is it possible to set the column with of the table I get out of the {workitems} macro.

I have a workitems table with four colums and the column containing the information of a ritch text field is too big, so the last column is cut off.

Re: Set {workitems} table column width

Posted: Wed Feb 15, 2012 9:09 am
by vinicius.zavam
Hey,
I needed the same.
Here is some workaround I did by using pre-built table classes to use Polarion-like {workitems} macro table style.

Code: Select all

#set ($myquery = "project.id:playground AND type:task")
#set ($items = $trackerService.queryWorkItems($myquery, id))
<div>
<table class="itemsTable" style="width:100%;">
 <thead> <tr>
 <th width=15><b>01</th>
 <th width=85><b>02</th>
 <th width=50><b>03</th>
 </tr> </thead>
 <tbody>
 #foreach ($i in $items)
  <tr>
  <td> A </td>
  <td> B </td>
  <td> C </td>
  </tr>
 #end
</tbody> </table>
<div class="panelFooter" style="width:100%;"> QUERY: $myquery </i></div>
</div>


You may adapt to your needs and, for sure, you can use a better query and details (chic cells content, with images and whatever).
Things like links to workitem, custom fields and so... can be done by using wiki code or Polarion API.

If you like to use the {workitem} macro itself, to get pretty details (as cell content)...

Code: Select all

{workitem: $i.id}


You may use other wiki and API features to get a nicer and detailed table.

Code: Select all

{image:myimage.gif|20} $i.getCustomField("blablabla").name


I do know it's not exaaaaactly the thing you want, but... by viewing the SyntaxHelp wiki page or the Polarion Help document I couldn't get a better solution using the {workitems} or {table} macros. You may try, or not, to use {section}, {column} and {style} macros combined to get other pretty stuff, report page, ...

Re: Set {workitems} table column width

Posted: Mon Feb 20, 2012 5:40 pm
by Spring
Thank you very much for the hint, I didn't think about that.

I just started working with the $trackerService today (building my own trace table).

The API calls are to complicated for most users and we don't have a own documentation space for selfmade stuff atm, so I think my company will stick to the macros and the good polarion syntax help pages.

Re: Set {workitems} table column width

Posted: Tue Feb 21, 2012 1:27 pm
by vinicius.zavam
you're welcome;
good luck.