Thanks
Ok so if the condition is being met in the JS where do you suggest I start to troubleshoot?
Paul
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Browse Form color row
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Browse Form color row
<div> will create a child element within the cell. Therefore you'll need to apply the new style to the child elements es well.
Instead of
Code: Select all
$("div[id^='nucell_" + row + "']").css("background-color", "#008000");
Code: Select all
const cells = $("div[id^='nucell_" + row + "']");
cells.addClass('red');
cells.children().addClass('red');
Code: Select all
.red {
background-color: red !important;
color: #ffffff;
}
Re: Browse Form color row
Hi,
I tried a slightly altered version of Kev1n's code from this thread and some of my rows get the wrong background-color.
My JS skills are basically non-existent so i have no idea what is wrong.
Additional observation: when sorting in the browse form by the column used in the condition in ascending order all rows get the conditional background-color applied.
When sorting in descending order all background-colors are correct. I tested with firefox and qutebrowser (QtWebEngine).
Any ideas
?
I tried a slightly altered version of Kev1n's code from this thread and some of my rows get the wrong background-color.
My JS skills are basically non-existent so i have no idea what is wrong.
Additional observation: when sorting in the browse form by the column used in the condition in ascending order all rows get the conditional background-color applied.
When sorting in descending order all background-colors are correct. I tested with firefox and qutebrowser (QtWebEngine).
Any ideas

You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Browse Form color row
Give this a go:
Code: Select all
function rowYellow() {
$('[data-nu-column="1"]').each(function () {
const cell = $(this);
const row = cell.attr("data-nu-row");
if (cell.html() === "0") {
$('[data-nu-row="' + row + '"]').css("background-color", "#FFE9A5");
}
});
}
if (nuFormType() === 'browse') {
rowYellow();
}