在我使用将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的情况下工作?非常感谢。
在谷歌上搜索了几个小时后,我发现了solution here
:
我已经把我的脚本:
$('#usersListTable').selectable({ filter: 'tbody tr' });
$('td').click(function () {
row_index = $.trim($(this).parent().find(".username").html());
});
内部
$(document).on('pageinit', function(){
});