【发布时间】:2015-09-23 14:23:22
【问题描述】:
有没有办法在页面中的所有数据表上显示选定的条目数,而不仅仅是单独显示?
这是单独的数据表:
var stockTable = $('#source').dataTable({
"aaData": src,
"sPaginationType": "full_numbers",
"bFilter": true,
"bProcessing": true,
"bRedraw":true,
"bDestroy":true,
"bInfo":true,
"bLengthChange":true,
"aoColumns": [
{"mData": "Title"},
{"mData": "ID"},
{"mData": "Language"}]
});
var catalogTable = $('#destination').dataTable({
"aaData": dest,
"sPaginationType": "full_numbers",
"bFilter": true,
"bProcessing": true,
"bRedraw":true,
"bDestroy":true,
"bInfo":true,
"bLengthChange":true,
"aoColumns": [
{"mData": "Module Title"},
{"mData": "Module ID"},
{"mData": "Module Language"}
],
"oLanguage": {
"sEmptyTable" : "<h1>Drag and Drop Courses Here</h1>"
}
});
如果有另一个类似的数据表并且我有一个选择框如下:
<div class="filterArea borderBottomMedium clearfix">
<div class="no_padding entriesLength">
<label>Show</label>
<select id="entries" class="form-control">
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
</select>
<label>entries</label>
</div>
我可以使用选择来显示所有数据表中的条目数吗?bLengthChange 为真,我可以单独更改两个表。但是如何将它们一起更改为选择框中选择的条目数?
【问题讨论】: