Change column color in Oracle apex - oracle

How can I change the background color of every second column using interactive report.

First of all I recommend using css. If you don't like CSS just go directly to IR section in my answer
CSS
th:nth-child(even),
td:nth-child(even){
background-color: red !important
}
or
th:nth-child(2),
td:nth-child(2) {
background-color: red !important
}
th:nth-child(4),
td:nth-child(4) {
background-color: blue !important
}
or
th#C152380905075548116,
td[headers="C152380905075548116"] {
background-color: red !important;
}
th#C152381026269548117,
td[headers="C152381026269548117"] {
background-color: blue !important;
}
where C152380905075548116 and C152381026269548117 are columns id that should be replaced.
IR
If you really need to use native IR functionalities you should follow 3 steps:
Change report SQL query so the column contains name of the color you want to use as background
eg:
select
...
VALUE1||'<span style="display: none">red</red>' as Artikl
VALUE2||'<span style="display: none">blue</red>' as "Broj gresaka"
..
from
..
Add IR highlights Actions > Format > Highlight
Name = Red background (Artikl)
Sequence = Sequence
Enabled = Yes
Highlight Type = Cell
Background Color = #FF7755
Text Color = null
Column = Artikl
Operator = Contains
Expression = red
and
Name = Blue background (Broj gresaka)
Sequence = Sequence
Enabled = Yes
Highlight Type = Cell
Background Color = #99CCFF
Text Color = null
Column = Artikl
Operator = Contains
Expression = blue
Set columns attribute Security > Escape special characters to No
It is not the perfect solution but it works :-)

Related

Geoserver ECQL LIKE Operator in CSS Style Results in Incorrect Legend

I'm attempting to create a geoserver style that will alter a fill based on the first letter (or letters) of a category name, using the CSS styling syntax. When Geoserver generates the legend based off the following style, it's seemingly creating a legend entry for every permutation of the three style rules. Any idea why the LIKE operator causes this behavior while the = operator does not?
geoserver legend example
/* #title 100 Year */
[cat LIKE 'A%'] {
fill: "#FB4852";
}
/* #title 500 Year */
[cat LIKE 'X5%'] {
fill: "#7D57A5";
}
/* #title Unspecified */
[cat LIKE 'D%'] {
fill: "#FFFD38";
}

Set default text alignment in CKEditor

By default CKEditor assumes that text should be left aligned. If you enable text-align buttons, and select text and align it left, it doesn't change the content at all e.g.
Some text >> Some text
Whereas selecting center or right alignment adds the appropriate inline styles e.g.
Some text >> <div style="text-align:center">Some text</div>
The assumption that text is left-aligned by default is not always correct. For example the editor's output may be inside a table cell with align="center". In this case the text will never be left-align-able.
Is there anyway to set the default alignment of text in the CKEditor config prior to instantiating the editor?
You can set the default alignment by changing the contents.css file.
body { text-align: center; }
Alignment buttons on the toolbar automatically recognize the style and toggle the correct button.
Use this code: config.contentsLangDirection = 'ltr'; for Left To Right alignment and config.contentsLangDirection = 'rtl'; for Right To Left:
CKEDITOR.editorConfig = function (config) {
...
// Default language direction
config.contentsLangDirection = 'rtl';
...
};

Colors are not concatenating correctly in Sass

I am trying to concatenate two colors in Sass:
$helloWorld: pink;
$secondString: red;
p {
color:$helloWorld + $secondString;
}
But the result is:
p {
color: pink; }
Why aren't the colors concatenating to produce pinkred?
This is because Sass treats all colors as their hex value, regardless if they're named like pink. They're all hex values under the hood. Per the Sass Documentation:
Colors
Any CSS color expression returns a SassScript Color value. This includes a large number of named colors which are indistinguishable from unquoted strings.
The emphasis is mine. The documentation states that the color value is returned, which is the hex value. The included link also shows that named colors such as pink are just hex values under the hood. To address the adding issue, refer to the documentation again:
Color Operations
All arithmetic operations are supported for color values, where they work piecewise. This means that the operation is performed on the red, green, and blue components in turn. For example:
p {
color: #010203 + #040506;
}
computes 01 + 04 = 05, 02 + 05 = 07, and 03 + 06 = 09, and is compiled to:
p {
color: #050709; }
The same principle applies here. When you use addition on colors, you aren't concatenating them like strings, so pink + red is not pinkred. Instead, the hex values are added piecewise. Here's an example:
$blue: blue;
$red: red;
p {
color: $blue + $red
}
This yields:
p {
color: magenta
}
From the example above, you can see that this does not perform string concatenation, but it's adding blue (#0000FF) and red (#FF0000) to create magenta (#FF00FF). In your case, pink (#FFC0CB) and red (#FF0000) are added piecewise to produce #FFC0CB, which is just pink. That's why you get pink instead of pinkred.
If you want to concatenate them like strings, do not use+. Instead, you can try string interpolation so the colors are treated as strings, not colors:
p {
color: $helloWorld#{$secondString}
}
That will yield:
p {
color: pinkred
}
You can also use a more verbose method so that it's forced to act like a string (unquote just gets rid of the quotes):
p {
color: unquote($helloWorld+ "" + $secondString);
}
Try it at SassMeister. Note that pinkred isn't a named colors in Sass.

SASS for each interpolation error when export css in compressed mode

I have a map declared like below
Map Definition
$color-array:(
black:#4e4e4e,
blue:#0099cc,
dark-blue:#14394e,
green:#2ebc78,
white:#ffffff,
orange:#ed6a0e
);
and calling the same in for each loop to generate class for text color and background color like below
#each $color-name, $color-value in $color-array{
.#{$color-name}{
color: $color-value !important;
}
.bg-#{$color-name}{
background: $color-value !important;
}
}
I am using gruntjs for for compilation, when i set output style to compressed it gives below error
You probably don't mean to use the color value #000' in interpolation
here. It may end up represented as #000000, which will likely produce
invalid CSS. Always quote color names when using them as strings (for
example, "#000"). If you really want to use the color value here, use
"" + $color-name'.
Error: Invalid CSS after ".": expected class name, was "#000"
on line 25 of SCSS/_base.scss
from line 5 of scss/style.scss
But when i set output style to expanded it runs fine.
In your colors array, change all the key double-quoted string keys and things should work.
$color-array:(
"black":#4e4e4e,
"blue":#0099cc,
"dark-blue":#14394e,
"green":#2ebc78,
"white":#ffffff,
"orange":#ed6a0e
);
An alternative of changing the SCSS code would be to make sure the variable is a string like the error message mentioned
#each $color-name, $color-value in $color-array{
.#{"" + $color-name}{
color: $color-value !important;
}
.bg-#{"" + $color-name}{
background: $color-value !important;
}
}

How to change row background color in SlickGrid

I started a new project in slickgrid.
I am working this sample.
How can I change the background color of the row I want ?
For example : first row backcolor to red , second row backcolor to blue ...
Thanks for your help.
If you always want your first row red, your second row blue etc then define it in css using the nth-of-type selector and the .slick-row class selector:
/*Colour the first row red*/
.slick-row:nth-of-type(1){
background: #FF0000;
}
/*Colour the second row blue*/
.slick-row:nth-of-type(2){
background: #0000FF;
}

Resources