facebook

How to select an item in selectlist with code ?? CLOSED

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

    alonso100
    Member

    hi,

    How can I select an specific item in a list with code ??

    thanks.

    #336268 Reply

    Hi Alonso,

    Please take a look at this thread with the same question: http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=3427

    #336373 Reply

    alonso100
    Member

    hello,

    the code in the example is incomplete. Surfing in the forum I found something else to complement it and it works like this:

    /**
     * Called when document is loaded.
     */
    phoneui.documentReadyHandler = function() {
      someFuntion();
    }
      
      
      function someFuntion(){
        var listName = 'list1';
        var itemToSelect = $('select[name='+listName+'] :selected').prop("selected", false);
       
        var itemNum = 2;
        var selId = $('#m1-MyList-list1' + '> li').each(
        function (i) {
          $(this)[i == itemNum ? 'addClass' : 'removeClass'](m1Design.css("selected"));      
        });
        phoneui.preprocessDOM('#m1-MyList-list1');
      }

    Hope this helps someone else too.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: How to select an item in selectlist with code ?? CLOSED

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