Page 1 of 1

Search Function

Posted: Tue Apr 05, 2022 10:33 pm
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.

Re: Search Function

Posted: Wed Apr 06, 2022 2:17 am
by kev1n

Re: Search Function

Posted: Fri Apr 08, 2022 6:30 am
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);

Re: Search Function

Posted: Fri Apr 08, 2022 6:54 am
by kev1n
There's a syntax error:

replace

Code: Select all

nuSetNoSearchColumns([4, 7, 9);
with

Code: Select all

nuSetNoSearchColumns([4, 7, 9]);