Page 1 of 1

use nuAddJavascript() in After Browse. [done]

Posted: Tue Jan 18, 2022 1:05 am
by steven
Hi kev1n,

nuAddJavascript() is currently not useable in After Browse.

But I believe if you were to change the current line to this, it would.

Code: Select all

	$f->lookup_javascript	= nuObjKey($GLOBALS,'EXTRAJS', '') . ";$r->sob_lookup_javascript";
lupj.PNG
Steven

Re: use nuAddJavascript() in After Browse.

Posted: Tue Jan 18, 2022 5:02 am
by kev1n
Steven,

I tried that by adding

Code: Select all

nuAddJavascript('alert("hello")');
in AB but the alert box didn't show up.

The reason is that nuAddJavascript() only assigns this extra js if isset($GLOBALS['EXTRAJS']);

By adding

Code: Select all

$GLOBALS['EXTRAJS']		= '';
in nuGetOtherLookupValues()

the alert box will be displayed.
extr.jpg
Can you try this out and see if it works?

Re: use nuAddJavascript() in After Browse.

Posted: Tue Jan 18, 2022 9:51 pm
by steven
Kev1n,

You're right.

Actually, I did that too but had forgotten.


Steven

Re: use nuAddJavascript() in After Browse.

Posted: Wed Jan 19, 2022 5:52 am
by kev1n
This is now on Github.