update of menu variable into the header

Hi in my menu header I have a global variable [account] , I woud like to update the account value into the header menu when a change occurs.Unfortunately I need to restart the menu application in order to see the change.
THere is a way to update the header menu variable dinamically (ajax ?)
without to re launch the menu application ?

Re: update of menu variable into the header

Did you ever find the answer to this ? I have the same requirement. I know the post is old.

Re: update of menu variable into the header

If you load the app using Firebug and then look at the NET tab you will see POST: menu.php where it returns the menu object on the RESPONSE tab.

The Object is MENU_APL_01

{ Code: 'Menu Item 1' .... }

You can try can update the _item object and update the menu object using a call built into CoolmenuPro. (scriptcase/prod/third/COOLjsMenu/coolmenupro_uncompressed.js)
From the console:

MENU_APL_01[1].code = 'New Menu Text';

I will let you fumble through that messy code to find the correct method load the changes to the object back to the display :wink:

If you look under the HTML tab in firebug, and inspect the menu item, you will see it simply creates table for displaying the menu. I see and id for the menu item (menu1_t_#), but not the table element.

Regards,
Scott.

Re: update of menu variable into the header

This is what I did to solve this without having to go through what Scott described:
I have 2 menus. One which has only one item on it: Forgot Password. It auto loads the login application. When the user has logged in I dynamically create the real menu and before displaying it set account, user name etc into header with global vars.
Hope this helps someone.

Re: update of menu variable into the header

Esta es mi solucion:

[manio]={anio};
[mmes]={mes};
sc_redir(menu, “”, “_parent”);
sc_alert(“Cambio Realizado al a?o: [manio] con el mes: [mmes]”);

Saludos!

1 Like

Re: update of menu variable into the header

See this example,

maybe this help you : http://www.scriptcase.net/knowledge/article-7.html

regards

Re: update of menu variable into the header

I would like to update the header each time I change of entry in my form.
So my header should look like :

  • “Editing: Contact1”
  • and then, after clicking on the Next button of the form, “Editing: Contact2”.

For now I can make the first point (using your example Max Veras), but when I change of entry into the form, the header is not updated.

Re: update of menu variable into the header

Hello,

Are you changing the value of your global variable each time you navigate through records?

regards,
Bernhard Bernsmann

Re: update of menu variable into the header

Here is the code that I am using :


$sql = "SELECT CONCAT(`FirstName`,' ',`LastName`) 
       FROM `Contact` WHERE `ContactId` = ".{ContactId};
	
sc_lookup(rs, $sql);


if(count({rs}) != 0){
	if({rs[0][0]} != ''){
		$contact_name = {rs[0][0]};
	}
	else{
		$contact_name = "Error1";
	}
}
else{
	$contact_name = "Error2";	
}

sc_set_global($contact_name);

I have put it into the onNavigate,onLoad and onRefresh, but my header never change, it just take the value of the first contact, and then it never change.

Re: update of menu variable into the header

Hello,

Instead of using sc_set_global, try setting contact_name as a global variable.

e.j.

if({rs[0][0]} != ''){
		[contact_name] = {rs[0][0]};
	}

regards,
Bernhard Bernsmann

Re: update of menu variable into the header

It doesn’t change anything.

Thank you for replying

Re: update of menu variable into the header

Hello,

Please contact our support, and they will be able to diagnose why the header isn’t updating properly.

regards,
Bernhard Bernsmann