Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
865
To access a menu item in javascript
posted

Hi,

      i want to change a text of a particular item when i click on a button. can someone tell me how to go abt it? i am new to infragisctics. Please it's urgent..

Thanks

JollyGuy

  • 21382
    posted

     Using the WebMenu CSOM

    You would first need to get the menu object 

    var menu = igmenu_getMenuById('yourIdHere')

     

    The menu object has a getItems() method

        getItems - Returns an array of Root Menu Items.

     

    If your menu you want to change is a sub menu off the main menu,you would first need to find the parent and then call  .getItems off that object to get the child menu options.

     

    When you get to your  menu item, you can call a .setText off it.