highlight records

Questions related to customising nuBuilder Forte with Javascript or PHP.

highlight records

Postby Audioko » Wed Feb 28, 2018 6:56 pm

Hi,

In version pro3 I could highlight records with the use of nuLoadBrowse function.
E.g. to distinct records of a product browse form that are no longer in stock.
How can I do this in Forte?

thanks,
Ko

Can I roughly use the same code and replace specific elements like 'row' with 'nucell' etc?
Attachments
code1.jpg
pro3 element inspector
code1.jpg (17.31 KiB) Viewed 2000 times
code2.jpg
forte element inspector
code2.jpg (16.28 KiB) Viewed 2000 times
code.jpg
js code in pro3
code.jpg (41.73 KiB) Viewed 2005 times
highlight.jpg
highlighted row where column 'Actief' is 0
highlight.jpg (25.69 KiB) Viewed 2005 times
Audioko
 
Posts: 14
Joined: Tue Feb 06, 2018 6:50 pm
Location: Amsterdam, The Netherlands

Re: highlight records

Postby admin » Wed Feb 28, 2018 8:31 pm

audioko,

There is no nuLoadBrowse() or nuLoadEdit().

All the Javascript on a Form gets run each time a Form loads.

This should help...

https://forums.nubuilder.com/viewtopic.php?f=19&t=9353&p=16144&hilit=nuFormType#p16144


Steven
admin
Site Admin
 
Posts: 3123
Joined: Mon Jun 15, 2009 9:53 am

Re: highlight records

Postby toms » Wed Feb 28, 2018 8:33 pm

Ko,

This works for me:

Code: Select all
if (nuFormType() == 'browse') {
    $('[data-nu-column="4"]').each(function (index) {

        var cellId = $(this).attr('id');
        var cellValue = $('#' + cellId).html();
        var rowNum = String(cellId).split('_')[1];

        if (cellValue == '0') {
            $("div[id^='nucell_" + rowNum).css("color", "red");
        }
    });
}
toms
 

Re: highlight records

Postby Audioko » Wed Feb 28, 2018 10:01 pm

Hi Steven, Tom,

Thanks a lot both of you.
It works for me now too.

I need to learn better Javascript / JQuery and sure I will....

Ko
Audioko
 
Posts: 14
Joined: Tue Feb 06, 2018 6:50 pm
Location: Amsterdam, The Netherlands

Re: highlight records

Postby admin » Thu Mar 01, 2018 2:39 am

.
admin
Site Admin
 
Posts: 3123
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code