Page 1 of 1

nuSearchAction: Uncaught TypeError

Posted: Mon Sep 14, 2020 6:35 am
by kev1n
Hi Steven,

nuSearchAction() can produce an "Uncaught TypeError: Cannot read property 'name' of null" if it's called from a Procedure or a Custom Code.
nuSearchAction.png

Fix:

Code: Select all

function nuSearchAction(S, F){

	if(arguments.length > 0){
		$('#nuSearchField').val(S);
	}
	if(arguments.length == 2){
		$('#nuFilter').val(F);
	}

	var s	= String($('#nuSearchField').val()).replaceAll("'","'", true);
	var f	= String($('#nuFilter').val()).replaceAll("'","'", true);
	
	window.nuFORM.setProperty('search', s);
	window.nuFORM.setProperty('filter', f);
	
	var c = arguments.callee.caller === null ? '' :  arguments.callee.caller.name;
	if(arguments.length === 0 && c != 'nuGetPage'){
		window.nuFORM.setProperty('page_number', 0);
	}
	if(arguments.length >= 1){
		window.nuFORM.setProperty('page_number', 0);
	}

	nuGetBreadcrumb();
	
}

Re: nuSearchAction: Uncaught TypeError

Posted: Thu Sep 17, 2020 3:18 am
by admin
kev1n,

That's done now.

Thanks


Steven