是否可以在jQuery的tablesorterpager插件中禁用分页(First,Previous,Next,last)链接。这是我用jQuery编写的代码
jQuery('#mentor_engagement_report_table')
.tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
.tablesorterPager({container: jQuery("#pager"), positionFixed: false,size:10});发布于 2011-07-27 14:50:07
我已经在github上创建了一个tablesorter插件的分支。读完这个问题后,我在名为updateArrows的分页插件中添加了一个新选项,当执行true时,它会将包含在新的cssDisabled选项中的类名应用于箭头。下面是初始化代码和一个demo
$("table")
// initialize tablesorter
.tablesorter()
// initialize the pager plugin
.tablesorterPager({
// target the pager markup
container: $("#pager"),
// disabled class name to use
cssDisabled : 'disabled',
// apply disabled class name to the pager arrows when the rows at either extreme is visible
updateArrows: true
});以下是演示中使用的css的一些示例:
/*** css used when "updateArrows" option is true ***/
/* the pager itself gets a disabled class when the number of rows is less than the size */
#pager.disabled {
display: none;
}
/* hide or fade out pager arrows when the first or last row is visible */
#pager img.disabled {
/* visibility: hidden */
opacity: 0.5;
filter: alpha(opacity=50);
}发布于 2011-07-25 17:42:14
如果你使用Pager Plugin只有分页,如果没有,没有任何东西会有分页部分…
如果你想隐藏寻呼机
在javascript代码之后添加:
$(".pager").hide();你的问题应该是,为什么我想要他的寻呼机区域?如果我只想显示10行,那么数据应该只包含10行...
发布于 2011-07-25 17:48:29
如果你发布了你的全部代码,并且更清楚你想要什么,这将会更容易。
是否仍要选择每页的行数?然后试试这个:http://jsfiddle.net/q66TA/
如果你不想从寻呼机中得到任何东西,就不要使用它..
更新:如果您需要当前页码和总页数,则需要将此功能添加到插件中。有一个可用于此的回调插件/补丁:http://www.vinertech.com/patches/tblsorter.pager.cbk.patch
更多信息:http://daveviner.blogspot.com/2009/12/jquery-tables-and-administrative.html
https://stackoverflow.com/questions/6814119
复制相似问题