Announcement

Collapse
No announcement yet.

update of menu variable into the header

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ?




  • #2
    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.

    Comment


    • #3
      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:
      { 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:

      Code:
      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


      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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!

          Comment


          • #6
            Re: update of menu variable into the header

            See this example,

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

            regards

            Comment


            • #7
              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.

              Comment


              • #8
                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

                Comment


                • #9
                  Re: update of menu variable into the header

                  Here is the code that I am using :
                  Code:
                  $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.

                  Comment


                  • #10
                    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.

                    Code:
                    if({rs[0][0]} != ''){
                    		[contact_name] = {rs[0][0]};
                    	}
                    regards,
                    Bernhard Bernsmann

                    Comment


                    • #11
                      Re: update of menu variable into the header

                      It doesn't change anything.


                      Thank you for replying

                      Comment


                      • #12
                        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

                        Comment

                        Working...
                        X