Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Browse Form color row
Browse Form color row
Hi
Is it possible to color whole row in a browse form based on a date in a column.
I know who to do it for a column but not the whole row
Thanks
Paul
Is it possible to color whole row in a browse form based on a date in a column.
I know who to do it for a column but not the whole row
Thanks
Paul
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Browse Form color row
Example to color the entire row if the first column matches today's date:
Code: Select all
const today = nuCurrentDate(); // retrieve today's date (format yyyy-mm-dd).
// to pass another format: const today = nuCurrentDate('dd.mm.yyyy');
$('[data-nu-column="0"]').each(function (index) { // 0 = 1st column
const id = $(this).attr('id');
const value = $('#' + id).html();
const row = String(id).split('_')[1];
if (value == today) {
$("div[id^='nucell_" + row + "']").css("background-color", "#D4EFDF");
}
});
Re: Browse Form color row
Hi Kevin
The row was not colored
used
The row was not colored
used
Code: Select all
$('[data-nu-column="13"]').each(function (index) { // 0 = 1st column
const id = $(this).attr('id');
const value = $('#' + id).html();
const row = String(id).split('_')[1];
if (String(value) == String(today)) {
console.log('v: ' + value + ' t: ' + today)
console.log('r: ' + row);
$("div[id^='nucell_" + row + "']").css("background-color", "#008000");
}
});
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Browse Form color row
HI Kevin
The BB has a temporary table and color based on date conditions for one column.
I notice in JS the console do show when the conditions are met just the rows do not color
Paul
The BB has a temporary table and color based on date conditions for one column.
I notice in JS the console do show when the conditions are met just the rows do not color
Paul
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Browse Form color row
$s1 = "IF(dle_ent_date BETWEEN '$today' AND '$days6', CONCAT('<div class=\"$green\">', ";
$s2 = ",'</div>'), IF(dle_ent_date BETWEEN '$days7' AND '$days13', CONCAT('<div class=\"$orange\">', ";
$s3 = ",'</div>'),";
$s4 = ")) ";
Part of the SQL
CREATE TABLE #TABLE_ID#
SELECT
dle_delord_id,
dle_freight_invoice_extra_text,
{$s1}dle_code{$s2}dle_code{$s3}dle_code{$s4} AS dle_code,
{$s1}dle_docket_no{$s2}dle_docket_no{$s3}dle_docket_no{$s4} AS dle_docket_no,
dle_ent_date AS dle_ent_date_disp,
dle_del_date AS dle_del_date_disp
FROM delord
ORDER BY dle_ent_date_disp DESC, dle_del_date_disp DESC
There are more columns
I have taken over the support of the system
DB Version V.4.5-2021.03.25.00
Files Version V.4.5-2021.03.25.00
Customer does not want to upgrade atm
Paul
$s2 = ",'</div>'), IF(dle_ent_date BETWEEN '$days7' AND '$days13', CONCAT('<div class=\"$orange\">', ";
$s3 = ",'</div>'),";
$s4 = ")) ";
Part of the SQL
CREATE TABLE #TABLE_ID#
SELECT
dle_delord_id,
dle_freight_invoice_extra_text,
{$s1}dle_code{$s2}dle_code{$s3}dle_code{$s4} AS dle_code,
{$s1}dle_docket_no{$s2}dle_docket_no{$s3}dle_docket_no{$s4} AS dle_docket_no,
dle_ent_date AS dle_ent_date_disp,
dle_del_date AS dle_del_date_disp
FROM delord
ORDER BY dle_ent_date_disp DESC, dle_del_date_disp DESC
There are more columns
I have taken over the support of the system
DB Version V.4.5-2021.03.25.00
Files Version V.4.5-2021.03.25.00
Customer does not want to upgrade atm
Paul
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact: