Color Coded Cards Oracle APEX

Опубликовано: 13 Октябрь 2024
на канале: Tech Mining
2,267
35

This tutorial will teach you how to create a page with color-coded cards and icons using employee data. The region query uses Universal Theme Color Modifiers and selects card color as the column. The region query is used to assign a color code to each row based on the value in the DEPT NUMBER column, Depending on the department number, it assigns different color codes. It also uses a column substitution in the CSS Classes to get the values. The ORDER BY clause is also included, used to sort the result set on Ename and Job columns in ascending order in the current scenario.

SQL Query
==============================================
select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO,
case when deptno = 10 then
'u-color-2'
when deptno = 20 then
'u-color-3'
when deptno = 30 then
'u-color-4'
when deptno = 40 then
'u-color-5'
end card_color
from EMP


CSS Inline
==============================================
:root {
--a-cv-subtitle-text-color: inherit;
--a-cv-subcontent-text-color: inherit;
}


CSS Class
============================================
&CARD_COLOR!ATTR.