Confluence table-plus rowStyles parameter examples - confluence

How to use rowStyles attribute for confluence wiki markup?
Could you please provide example?

The table-plus rowStyles parameter is a comma separated list of styles. Each style is made up of one or more properties.
The first is applied to all heading rows determined by the heading parameter. The remaining styles are applied to the remaining rows in order with repetition as necessary.
Example: , background:lightyellow;, background:lightblue;
Source: https://bobswift.atlassian.net/wiki/display/TBL/Table-plus+macro
If you scroll down the page a bit there are several example tables with styles included in the wiki-markup. Hope this helps.
EDIT: Here is an example of how I added rowStyles in wiki-markup
{table-plus:border=0|align=center|cellspacing=0|cellpadding=10|class=''|title='Table One'|highlightColor=white|columnTypes=S,F,F,F|rowStyles=style="background:red;",style="background:yellow;",style="background:blue;"}
That should produce a table, titled 'Table One,' with the first row being red, the second row being yellow, and the third row being blue.

Related

Is it possible to have multi/custom field type inside a w2ui grid column with inline-editing for each type based on cell value?

Is it possible to have a grid column containing multiple types inside of it based on the value of a cell? Where each cell is rendered based on value. For instance, with in the same column a cell could be of type 'text' or 'datetime' or 'list' etc... and for each type I can use built in inline-editing? See image illustration below. Basically a key/value editor where the value column need to contain more than one 'type. Please post a sample answer.
It's possible, but you cannot rely on standard funtionality.
The idea of a w2grid is to assign a renderer to a column and render all cells of the same column in the same way.
You could implement a render function for your column and then generate the HTML for each cell based on those arguments:
http://w2ui.com/web/docs/1.5/w2grid.columns
Or you could override getCellHTML() for your grid.
Have a look at the implementation of getCellHTML() to see what awaits you if you want to customize it:
https://github.com/vitmalina/w2ui/blob/master/src/w2grid.js#L7396
Although it was a hack solution I ended up creating multiple grids aligned vertically each with a property & value column but the value column's 'type' attribute is different for each grid based on the w2ui framework out of box functionality I Desired for it. Each Grid is also separated by the header without padding to give it a feel like it is one grid. See Image below. now obviously the draw back of this is you cannot sort on all the fields but this is not required in my use case.

Adding border to ag-grid column groupings/ pivot

Is it possible to add a border to the pivot groupings (or possibly just column groupings) on ag-grid? My groups are quite wide and I'm using material theme which makes it hard to read the grid clearly.
There doesn't seem to be any api exposed or css class to use?
e.g. sum (gold) or whatever column is on the left of the group would have border-left css to demark from the previous group.
https://www.ag-grid.com/javascript-grid-pivoting/#example-simple-pivot
Try to add cellClass and headerClass.
Add CSS to this class and also to ag-header-group-cell-with-group.
Plunkr:
https://next.plnkr.co/edit/ZQ1rv0cwau99oarH

Modify an ag-grid row after rendering

I need to slightly modify a ag-grid row after it has been rendered. In ag-grid, the actual HTML elements are not necessarily persistent, so manually-set styles may fall off.
For one thing, I have to modify the selection checkbox to set its tabindex to -1. This can technically be done in the cellRenderer callback, although it looks quite hacky. (The checkbox can be found at params.eGridCell.children[0].children[0].wrappedElement.)
But I also have to add a CSS class to some rows to highlight them based on external criteria. I haven't found a way to do this at all.
The best solution would seem to be using some sort of after-rendering callback, but to my knowledge no such thing exists.
I found a couple of related questions, but they were both resolved via cellStyle, which would not suffice here:
Row formatting in ag-Grid
How to provide a background color for an entire row in ag grid based on a certain value in a column?
You have not 1 but 3 options:
getRowClass(params):
Callback version of property 'rowClass'. Function should return a string or an array of strings.
getRowStyle(params):
Callback version of property 'rowStyle'. Function should return an object of CSS values.
processRowPostCreate(params):
Allows you to process rows after they are created. So do final adding of custom attributes etc.
In this last one you have the row in params.eRow.
All taken from https://www.ag-grid.com/javascript-grid-callbacks/index.php

How to change the table row background color while the conditions fails?

I am merging three coloumns and showing the merged values in the 4th column, am appliying some rules for merge operation. In some case that rules will bring up null value and display it in any row in the 4th column, i want to highlight the null row alone in RED color.
Like listed below.
Value1
Value2
NULL(Red color)
Value 4
please help me on this, Am working in wicket framework.
You can use AttributeModifier.replace("class", IModel<?>). Put a string in the model of the css tag you have to make it red. For example td.redbox {backgroundcolor:red} with AttributeModifier.replace("class", Model.of("redbox"));.
ps.
You need to supply more code next time. If you ask a unclear question, you'll get an unclear answer.

Stretch a row with data overflow while having multiple rows in a single band

My requirements bind me to have multiple rows in a single "Details" band.
Right now I am having a static text field (which is highlighted in color) in the leftmost column and three text data fields next to it.
What I want in my report is, the static text band along with the three bands should stretch in height when data in either of the three bands overflows, with the next row "properly" displayed below the stretched row. By "properly" I mean the next row elements should have their "top" values the same and be displayed in the same "row".
I tried setting "Stretch with overflow" flag to "true" and "Position" to "float" but the problem is that the next row data is not properly positioned.
I have found the answer. The key to the solution is grouping the elements inside a row together.
Remove all the static text labels. Use text fields instead, with the text in quotes. They can be grouped with other text fields and data fields.
Put all the data fields after the quoted text field in the same group as the quoted text field.
Now, do the same with all the rows that you want to display. Separate group for individual row.
Select all the elements in a group, or, all the elements in all the gorups and do this:
Set "Position" to "Float"
Set "Stretch Type" to "Relative to the tallest object"
Check "Print when detail overflows" checkbox.
Check the "Stretch with overflow" checkbox.
That's all we can do to make things "stretch" together.
Now, the band would have to stretch dynamically with these stretched details. Just go to the band properties, set Split type to "Default" and split allowed to true. This did the trick for me.
In case someone comes up to this problem and above answers don't work. I suggest checking your xml's root element. If it has the following attribute then remove it:
printOrder="Horizontal"
Then above answers should work.
Hope I'll save someone a day of googling the same stuff.
In my case doing as you advised didn't work. I had to modify your solution a little bit - I made a "frame" instead of grouping objects, and put previuosly grouped elements in that frame. I set positionType="Float" and stretchType="No stretch" in that frame, and set stretchType="RelativeToTallestObject" to its child items - then it all works.