删除行并更改分页计数器

delete rows and change pagination counters?

本文关键字:分页 计数器 删除行      更新时间:2023-09-26

我想在删除行(s)后将1 تا 6 از 36 =translator更改为EN=> 1 to 6 of 36(点击链接 delete )在表中。
示例:总行是36,如果我们删除3行,这总行在线更改为33(就像选择框的选择值并更改表的这一部分一样)。

你可以看到这个链接:http://binboy.gigfa.com/admin/accommodation/show
以下是我完整的js代码:http://binboy.gigfa.com/files/js/admin.js

这与你的问题没有特别的关系,因为你不是很清楚,但是下面是描述你需要的解决方案

<div id="score">
    <span id="upper">1</span>
    <span id="to">to</span>
    <span id="lower">3</span>
</div>
<div id="chk">
    <input type="checkbox"  /><br/>
    <input type="checkbox"  /><br/>
    <input type="checkbox"  /> <br/>
</div>
<input type="button" value="Delete" id="del" /> 

和jquery部分

$("#del").click(function(){ 
    var length = $(":checkbox:checked").length;   //get the number of checkboxes that are checked
    var v = parseInt($("#lower").text(),10)-length;    
    $("#lower").html(v);
    $(":checkbox:checked").remove();
});

这是小提琴http://jsfiddle.net/wYdZb/4/