facebook

get date combobox: CLOSED

💡
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 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #323092 Reply

    Yann
    Member

    Hello
    i try to get date to automaticly select a combobox named m1-resa-hidden-select-jourResa
    $(“#m1-resa-hidden-select-jourResa option[value=today.getdate()’]”).attr(‘selected’,’selected’);
    but nothing happen
    any idea?
    thanks
    Yann

    #323094

    support-michael
    Keymaster

    @Yann

    Q1: Should it be todate.getDate() instead of today.getdate()?

    I am wondering if your combo’s value is being set but the widget display is not updating. Try this:

    Immediately after executing

    $(“#m1-resa-hidden-select-jourResa option[value=today.getdate()’]”).attr(‘selected’,’selected’);

    Click the combo and see if the spinner selection the value from today.getDate(). If the spinner’s value is set to today’s date then there may be a problem with the combo’s text is not updating that we will need to investigate.

    #323095

    support-michael
    Keymaster

    @Yann

    I have confirmed that the combo text does not update in 1.4.1 if programmatically updating its hidden <select> element. I am discussing with the dev team now the possibility of fixing this for 1.4.2 planned for late next week.

    #323099

    Yann
    Member

    Hello Wayne
    nothing happen with
    $(“#m1-resa-hidden-select-jourResa option[value=today.getdate##’]”#.attr#’selected’,’selected’#;
    the value of my combo stay on 1st January
    i tried this
    var today=new Date()
    alert(today); return 8 it’s ok

    Thanks

    #323136

    support-michael
    Keymaster

    @Yann

    >alert(today); return 8 it’s ok

    For my clarification, is your code not selecting the option with value=8?

    If no, how are you confirming that value is not being set, e.g., observation in UI, running snippet in Test Center’s JS console, other…?

    #323171

    Yann
    Member

    @Wayne

    i put an alert(today) to be sure than the date returned is the date of current day.
    but combobox stay selected to 1st
    Yann

    #323185

    support-michael
    Keymaster

    @Yann

    After programmatically setting the combo’s value please run phoneui.preprocessDOM() which will update the combo’s state. support-vadim reminded me that I forgot to make that call to resync the widget’s UI with its internal state.

    //select option by value
    $('select[name=combobox1]').val("value2").attr("selected","selected")
    phoneui.preprocessDOM(); //force combo UI to refresh

    Please let me know if this resolves your issue.

    #323192

    Yann
    Member

    work fine
    thanks a lot Wayne

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: get date combobox: CLOSED

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