0

在我使用以下方法设置 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 一起工作?谢谢!

4

1 回答 1

1

谷歌搜索几个小时后,我发现solution here

我已经把我的脚本:

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

里面

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

});
于 2013-12-01T11:55:19.310 回答