Open
Conversation
把定义对象改成以函数方式获得,并在JS最开头定义一个kkpager对象,以使点击事件有效.同时需要把放置翻页控件的div定义为指定id.
把kkpager由id改成class,然后重新定义其他的id作为传入参数.
<div id="kkpager_XXXXXXX" class="kkpager"></div>
使用方法调整一下:
//生成分页控件
kkpager = getKKPagerObject('kkpager_XXXXXXX');
kkpager.generPageHtml({
pagerid : 'kkpager_XXXXXXX',
pno : 1,
mode : 'click', //设置为click模式
//总页码
total : totalPage,
//总数据条数
totalRecords : grantMenuListJson.length,
//点击页码、页码输入框跳转、以及首页、下一页等按钮都会调用click
//适用于不刷新页面,比如ajax
click : function(index){
//这里可以做自已的处理
//处理完后可以手动调用selectPage进行页码选中切换
this.selectPage(index);
},
//getHref是在click模式下链接算法,一般不需要配置,默认代码如下
getHref : function(n){
return '#';
}
});
把定义对象,改为获取对象.实现在一个页面定义多个分页控件.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关于 Issue #5
把定义对象,改为获取对象.实现在一个页面定义多个分页控件.
我没有修改min的js.
希望能够接受.
谢谢.