Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Search Function

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
tpolimeni28
Posts: 25
Joined: Mon Apr 04, 2022 4:00 pm
Has thanked: 1 time

Search Function

Unread post by tpolimeni28 »

Hello, I was messing around and trying to figure out a way opposed to clicking the three lines in the top left and unchecking the rows/columns I want to exclude from the search query. Is there a faster simpler way to do such with adding a button or how can I by default just exclude rows without alerting ther search function. Say I want to only to search by site name and exclude contact phone number and address from the results.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Search Function

Unread post by kev1n »

tpolimeni28
Posts: 25
Joined: Mon Apr 04, 2022 4:00 pm
Has thanked: 1 time

Re: Search Function

Unread post by tpolimeni28 »

kev1n wrote: Wed Apr 06, 2022 2:17 am Hi,

Use nuSetNoSearchColumns()
Thank you, seems when I add this under the custom code of the form page, it removes the use of my export to csv code. Im going to guess this some how needs seperated as a new function with in this section, the question I have not knowing php and trying to learn on the fly what syntax would be required to have both the custom sort, and export to csv working together?

Code: Select all

function base64encode(str) {
	let encode = encodeURIComponent(str).replace(/%([a-f0-9]{2})/gi, (m, $1) => String.fromCharCode(parseInt($1, 16)))
	return btoa(encode)
}


function browseDownloadToCSV() {
	nuSetProperty('browse_sql', base64encode(JSON.stringify(nuCurrentProperties().browse_sql)));
	nuRunPHP('BrowseDownloadToCSV'); 
}


if(nuFormType() == 'browse'){
    nuAddActionButton('browseDownloadToCSV', 'Download to CSV', 'browseDownloadToCSV();');
}

if (nuFormType() == 'browse') {

    $(window).scroll(function(e) {

        var scrollTop = $(window).scrollTop();

        $('.nuBrowseTitle').each(function() {
            if (scrollTop > 0) {
                $(this).css({ 'top': scrollTop, 'z-index': '100', 'position': 'fixed' });
            } else {
                $(this).css({ 'top': 3, 'z-index': '0', 'position': 'absolute' });
            }
        });
    });

}

nuSetNoSearchColumns([4, 7, 9);
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Search Function

Unread post by kev1n »

There's a syntax error:

replace

Code: Select all

nuSetNoSearchColumns([4, 7, 9);
with

Code: Select all

nuSetNoSearchColumns([4, 7, 9]);
Post Reply