facebook

changing options for SelectListMenu dynamically

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #321350 Reply

    SonamGyato
    Member

    This message has not been recovered.

    #321376

    jcarm
    Member

    This message has not been recovered.

    #335544

    JohnJake2
    Member

    Hi.
    I am facing about the same problem. I created a Menu and selecting its values just works fine. But at some point I need to modify the entries in the selection list. Therefore I created a new little function which seems to touch at least the correct point, but just the text of the object is changed. But no changes according the items. No new entry, and even deleting all current items just seems to have no effect.

    
    function updateMenuItems()
    {
      var list = document.getElementById( "m1-MyMenu-selectListMenu1" );
     
      while ( list.childNodes.length > 0 )
      list.removeChild( list.childNodes[list.childNodes.length-1] );
    
      var person = document.createElement('person');
      person.setAttribute('id', '#m1-hidden-x1');
      person.setAttribute('innerText', 'Text');
      person.setAttribute('val', 'myvalue');
      person.setAttribute('value', 'myvalue');
      person.setAttribute('selected', 'selected');
      person.setAttribute('name', 'name');
    
      person.innerText = 'Text';
    
      list.appendChild(person);
    
      phoneui.preprocessDOM('#m1-MyMenu'); 
      alert('done!');
    }
    

    Maybe someone can complete/correct my sample project (see attachment).
    JohnJake2

    Attachments:
    You must be logged in to view attached files.
    #335701

    Hi JohnJake,

    We have provided a example to populate dynamically select here:
    http://www.genuitec.com/support-genuitec/viewtopic.php?p=14030#p14030

    Hope it is helpful for you.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: changing options for SelectListMenu dynamically

You must be logged in to post in the forum log in