Change of column color

Questions related to using nuBuilder Forte.

Change of column color

Postby Janusz » Thu Jan 10, 2019 10:06 pm

Hi,
for specific rows color change in browse form I can use the code as below, from one of the topic disscussed before on the forum - and it works fine.

but the question I have is:
Can you give some tips how to change the complete column color (from the very top to the bottom in browse form) ?


Code: Select all
if (nuFormType() == 'browse') {
    $('[data-nu-column="2"]').each(function (index) {
        var cellId = $(this).attr('id');
        var cellValue = $('#' + cellId).html();
        var rowNum = String(cellId).split('_')[1];
        if (cellValue == "completed") {
$("div[id^='nucell_" + rowNum + "']").css("color", "blue");
}
        else {
} });}
Janusz
 
Posts: 41
Joined: Fri Dec 28, 2018 10:11 pm

Re: Change of column color

Postby kev1n » Thu Jan 10, 2019 10:34 pm

To color row 3 (0 = first column):

Code: Select all
$('[id^=nucell_][id $=_2]').css("color", "blue");
$('#nusort_2').css("color", "blue");
kev1n
 
Posts: 53
Joined: Mon Oct 15, 2018 2:13 am

Re: Change of column color

Postby Janusz » Sat Jan 12, 2019 6:08 pm

Thanks, it's working well.

Additionally I added in the else statement color black as I noticed that after some time some lines were staying blue and it should not.

Code: Select all
.....
$("div[id^='nucell_" + rowNum + "']").css("color", "blue");
}
        else {
$("div[id^='nucell_" + rowNum + "']").css("color", "black");
}
....
Janusz
 
Posts: 41
Joined: Fri Dec 28, 2018 10:11 pm

Re: Change of column color

Postby kev1n » Sat Jan 12, 2019 6:10 pm

You're right, I noticed that too.
kev1n
 
Posts: 53
Joined: Mon Oct 15, 2018 2:13 am


Return to General



cron