【问题标题】:jQuery mobile dropdownlist doesn't hides with http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.jsjQuery 移动下拉列表不隐藏 http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js
【发布时间】:2013-01-04 01:23:18
【问题描述】:

得到了这个 ddl,它适用于这个版本的 jQm “http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js”: 但是,如果我将其更改为 1.2.0,则项目永远不会隐藏。有人见过这个问题吗?

                <asp:DropDownList ID="LanguageDropDownList" OnSelectedIndexChanged="LanguageDropDownList_OnSelectedIndexChanged"
                data-native-menu="false" AutoPostBack="true" runat="server">
            </asp:DropDownList>

【问题讨论】:

    标签: jquery-mobile


    【解决方案1】:

    jQuery Mobile 和 asp.net Web 表单基本上不能一起工作。回发模型和 jQuery Mobile 的 ajax 表单加载和导航不兼容。移至 MVC 或关闭 ajax。

    确保在 jQuery Mobile 初始化之前调用此代码。 (将它包含在引用 jQuery Mobile 的标记之前。)

    <script src="jquery.js"></script>
    <script>
        $(document).bind("mobileinit", function() {
          $.mobile.ajaxEnabled = false;
        });
    </script>
    <script src="jquery-mobile.js"></script>
    

    http://jquerymobile.com/demos/1.2.0/docs/api/globalconfig.html

    【讨论】:

    • 没用。您是否认为它不适用于 Web 表单?为什么我不应该将 ajax 与网络表单一起使用?我知道使用 MVC 会更好,但构建“应用程序”的不是我。有一天我会试探性地将它重建为 MVC,但现在没有时间 :)
    • jqm with ajax 依赖于&lt;div data-role="page"&gt; 区域内的回发,每个区域都有自己的&lt;form&gt; 元素。 Web 表单只允许包含所有标记的单个表单。这两种不同的方法用 ajax 打破了 jqm。如果不关闭 ajax 加载,您将永远无法使用 Web 表单。
    猜你喜欢
    • 1970-01-01
    • 2013-01-23
    • 1970-01-01
    • 2012-08-26
    • 2013-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多