【发布时间】:2014-01-10 05:51:28
【问题描述】:
我正在使用 Tablesorter 以及 Grouping 小部件以及启用的 Pager 小部件。我面临一些问题:
考虑分页的项目数还包括我要排除的组行。
此外,当我单击下一个按钮时,会显示上一页的记录。
我有一个全选复选框,在第二页上,当我选中全选复选框时,分组丢失了。
你能帮帮我吗
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// hide bottom pageBlockbuttons
$(".pbBottomButtons").last().hide();
});
function toggleBottomPageBlockButtons() {
setTimeout(function(){
var availableRows = $('table[id$="casesTable"] tr').not(":hidden").length;
if(availableRows > 12) {
$(".pbBottomButtons").last().show();
}
else {
$(".pbBottomButtons").last().hide();
}
},500);
}
</script>
<script type="text/javascript" charset="utf-8">
$('table[id$="casesTable"]').tablesorter({
sortList: [ [1, 0] ],
sortForce: [ [1, 0] ],
widgets: ["filter","group", "columns", "zebra" ],
widgetOptions : {
// css class applied to the table row containing the filters & the inputs within that row
filter_cssFilter : 'tablesorter-filter',
// filter widget: If there are child rows in the table (rows with class name from "cssChildRow" option)
// and this option is true and a match is found anywhere in the child row, then it will make that row
// visible; default is false
filter_childRows : false,
// Set this option to true to use the filter to find text from the start of the column
//
filter_startsWith : false,
group_collapsible : true,
group_collapsed : false,
group_count : " ({num})",
group_dateString : function(date) {
return date.toLocaleString();
},
group_formatter : function(txt, col, table, c, wo) {
return txt === "" ? "Empty" : txt;
},
group_callback : function($cell, $rows, column, table){
// var subtotal = 0;
// $rows.each(function(){
// subtotal += parseInt( $(this).find("td").eq(column).text() );
//});
//$cell.find(".group-count").append("; subtotal: " + subtotal );
},
group_complete : "groupingComplete"
}
}).tablesorterPager({container: $("#pager")});;
// check uncheck all functionality
$("#checkUncheckAll").click(function() {
$(".selectionCheckbox").not(":hidden").attr('checked', this.checked);
});
// uncheck all checkboxes when user clicks on next/previous page
$("#pager a img:not(.disabled)").click(function(){
$("#checkUncheckAll").attr('checked', false);
/* $(".selectionCheckbox").attr('checked', false); */
});
</script>
【问题讨论】:
-
Mottie 你能帮帮我吗?如果需要,我很乐意分享任何其他详细信息
-
我为同一个jsfiddle.net/vnt_manu/hM6gD创建了一个js小提琴
标签: grouping paging tablesorter