Search code examples
htmljquery-mobileappmobi

Can anyone suggest an alternative to select drop-down box with JQuery Mobile?


I've built a JQuery Mobile based app, wrapped in AppMobi, released for both iOS and Android. To date I've heard of no major issues. Today I heard that a user with Android ICS is having repeatable crashes when accessing any drop down select boxes - I cannot reproduce the problem with my older test unit. I've had them try my raw html site as well - which does not yield the same behaviour, but the AppMobi guys seem to take a dim view on the use of JQuery Mobile so dont anticipate much help from that quarter.

My main alternative is likely going to be replacing the standard select drop down select boxes with some alternative.

Can anyone suggest an alternative (the simpler the better) that will yield the same functionality as the below code?

<select id="punits">
    <option value="in_H2O">in H2O</option>
    <option value="in_HG">in Hg</option>
    <option value="psi">psi</option>
    <option value="cm_H2O">cm H2O</option>
    <option value="cm_HG">cm Hg</option>
    <option value="kPa">kPa</option>
  </select>

Thanking you in advance


Solution

  • In order of the simpler the better - Here's a one line fix: Might I suggest using the jQuery Mobile built in custom select menu? Documentation @ http://view.jquerymobile.com/master/demos/selectmenu-custom

    Basically use the same html but add this line to your mobileinit

    $.mobile.selectmenu.prototype.options.nativeMenu = false;
    

    This will yield all select menus being rendered by jQuery Mobile instead of the native controls