Tablesorter版本:2.22.3
我使用AJAX从服务器端获取数据,但最后表行始终为10。 附: tablesorterPager size属性已设置为9999 表格行将显示所有数据。 HTML和JS是
$(function () {
var gv_table;
gv_table= $("#Info").tablesorter({
theme: 'blue',
sortList: [[0, 0]],
widthFixed: true,
widgets: ['zebra', 'columnSelector', 'stickyHeaders'],
widgetOptions: {
columnSelector_container: '#ColumnSel',
columnSelector_columns: {
},
}
})
.tablesorterPager({
// target the pager markup - see the HTML block below
container: $("#infopager"),
size: 9999,
output: 'Showing: {startRow} to {endRow} (Total:{totalRows})'
});
});
$('#btnQuery').click(function () {
$.ajax({
url: "../Handler/DataSrcHandler.ashx?TableName=UserInfo",
type: 'POST',
data: {
DataSrc: $("#SelEnviro").val(),
Datakey: $("#txtUserKey").val()
},
success: function (response) {
$('#info tbody').empty().append(response);
$('#info').trigger('update');
}
});
};

<div id="infopager" class="pager" style="width:180px">
<span style="width:180px;color:blue" class="pagedisplay"></span>
</div>
<div style="overflow:auto;width: 500px;height:150px" >
<table id="Info" class="tablesorter">
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Sex</th>
<th>Address</th>
<th>Class</th>
<th>EngName</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>
</div>
&#13;
<tr>
<td align='center' valign='top' nowrap>Peter</td>
<td align='center' valign='top' nowrap>0123456789</td>
<td align='center' valign='top' nowrap>Boy</td>
<td align='center' valign='top' nowrap>NA</td>
<td align='center' valign='top' nowrap>A</td>
<td align='center' valign='top' nowrap>Peter</td>
</tr>