1

I've previously used popups with JQueryMobile 1.3 and older without problem. With the new 1.4 RC1 I'm finding my popups don't update when I select a different item.

You can see an example here with JQueryMobile 1.3 http://jsfiddle.net/vinomarky/56hQ9/

And another here using JQueryMobile 1.4RC1 - identical code, but the select box no longer updates when different options are chosen; http://jsfiddle.net/vinomarky/B9TqL/1/

Any ideas of what to try? the code is as follows;

<a href="#popupBasic16" data-rel="popup" data-role="button" data-inline="true" data-position-to="origin" id="log_or_norm">Lognormal</a>

<div data-role="popup" id="popupBasic16">
    <div data-role="fieldcontain">
        <fieldset data-role="controlgroup">
            <input type="radio" name="updown" id="updown46" value="Lognormal" checked="checked" />
            <label for="updown46">Lognormal</label>
            <input type="radio" name="updown" id="updown47" value="Normal" />
            <label for="updown47">Normal</label>
        </fieldset>
    </div>
</div>

And Javascript

$('select').selectmenu();

$('#updown46').click(function () {
    $('#log_or_norm .ui-btn-text').html('Lognormal');
    $('#popupBasic16-screen').click();
    document.select_choices.log_or_norm.value = "Lognormal";
    $('select').selectmenu('refresh');
});

$('#updown47').click(function () {
    $('#log_or_norm .ui-btn-text').html('Normal');
    $('#popupBasic16-screen').click();
    document.select_choices.log_or_norm.value = "Normal";
    $('select').selectmenu('refresh');
});
4

2 回答 2

2

您的 Javascript 有一些document.select_choices未定义的错误。如果要更新按钮的值,请使用 jQuery:

$('#log_or_norm').text("Lognormal");

似乎在 jQuery 1.4 中他们改变了按钮的 HTML 结构,这就是你的代码$('#log_or_norm .ui-btn-text').html('Lognormal');不起作用的原因。在此处查看完整的更改页面。

演示在这里

于 2013-11-06T10:44:34.233 回答
2

两种方法

 $('#log_or_norm').text('Normal');

其他

$('#log_or_norm ').empty().append('Lognormal');

小提琴

http://jsfiddle.net/B9TqL/3/

于 2013-11-06T10:55:05.470 回答