【问题标题】:jquery ui does not work after ajaxenabled falseajaxenabled false 后 jquery ui 不起作用
【发布时间】:2013-12-01 10:44:22
【问题描述】:

在我使用以下方法设置 ajaxenabled false 之后:

<script type="text/javascript">
            $(document).bind("mobileinit", function () {
                $.mobile.ajaxEnabled = true;
            });
</script>

我的可选择表不起作用

$('#usersListTable').selectable({ filter: 'tbody tr' });
    $('td').click(function () {
        row_index = $.trim($(this).parent().find(".username").html());
    });

<table id="usersListTable" class="list">
 <thead>
    <tr>               
        <th>
            @Html.DisplayNameFor(model => model.Loginname)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>        
        <th>
            @Html.DisplayNameFor(model => model.IsAdministrator)
        </th> 
    </tr>
 </thead>
 <tbody>
@foreach (var item in Model)
{
    <tr>                     
        <td class="username">
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>        
        <td class="centeredtd">
        @GlobalHelpers.Checkbox(item.IsAdministrator)           
        </td> 
    </tr>
}
<tbody>
</table>

但是一旦我将 ajaxenabled 设置为 true 它就开始工作,有没有办法让它与 ajaxenabled false 一起工作? 谢谢!

【问题讨论】:

    标签: jquery jquery-ui razor jquery-mobile-ajax


    【解决方案1】:

    谷歌搜索几个小时后,我找到了solution here

    我已经把我的脚本:

    $('#usersListTable').selectable({ filter: 'tbody tr' });
        $('td').click(function () {
            row_index = $.trim($(this).parent().find(".username").html());
        });
    

    里面

    $(document).on('pageinit', function(){
    
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-13
      • 1970-01-01
      • 2017-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多