Code Monkey home page Code Monkey logo

mricode.pagination's Issues

返回函数的返回值对"total"的赋值问题

ajaxCallBack: function (result) {
            var total = utility.mapObjectNameRecursion(result, this.options.remote.totalName);
            if (total == null || total == undefined)
                throw new Error("the response of totalName :  '" + this.options.remote.totalName + "'  not found.");
            total = utility.convertInt(total);
            this.total = total;
            var lastPageNum = this.getLastPageNum();
            if (this.currentPageIndex > 0 && lastPageNum - 1 < this.currentPageIndex) {
                this.setPageIndex(lastPageNum - 1);
                this.remote();
            } else {
                if (typeof this.options.remote.success === 'function') this.options.remote.success(result);
                this.renderPagination();
            }
        },

代码中total的赋值不够灵活,这样的赋值方式固定死了返回的数据格式
必须如下: data = {total: 'xxx'},实际返回数据格式是不确定的,所以这块最好在 this.options.remote暴露出来。

不会用

在IE和chrome上运行test例子都出现问题,chrome是指无法请求data.json。大概是url不支持。IE上莫名其妙说btn_search没有定义,删除后还是没有什么效果。真是分页插件都没一个简单好用的。

关于 method setParams 的体验

很多情况下, 是在原有的param上进行部分参数的修改, 然后发请求.
已存在setParam, 建议提供一个getParam,
这样在海量的参数中, 一个获得原有的, 修改部分参数, 然后在set.
因为在set中直接extend也不太好把控.

缺少错误回调

一些时候请求错误,这时候需要错误回调,只在控制台扔出一个错误信息有时候不够。

搜索后Jump框会消失

打开页面后是正常的
temp1

执行模糊搜索,无数据
temp22

删除模糊搜索关键字,出现数据,分页正常,但是Jump框消失
temp2

设置pageSizeItems报错

Uncaught TypeError: Cannot read property 'pageSizeItems' of undefined mricode.pagination.js:79
我看了代码,这一行少了一对括号(粗体),应写成:
this.options.pageSizeItems = options.pageSizeItems || (($.fn.pagination.defaults &amp;&amp; $.fn.pagination.defaults.pageSizeItems) ? $.fn.pagination.defaults.pageSizeItems : defaultOption.pageSizeItems**)**;

PHP connection assistance

Hello,
Is there anyone available to help me with integrating this pagination with my PHP database? I would like to use this script to pull images from my database one page at a time as the user clicks through the pagination links.

Thanks

厉害

谢谢你写的这个插件。 不过在手机上输入框不能使用,这个问题,我这边应该怎么改。

不太理解暴露出来的setPageIndex方法的作用

setPageIndex: function (pageIndex) {
if (pageIndex !== undefined && pageIndex !== null) {
this.currentPageIndex = utility.convertInt(pageIndex);
}
}

可以看出来仅仅是赋值给了当前页码,并没有对已经存在的分页做相应的处理哇?
这个方法是用来做什么用的?

小量数据, 致命性体验 切换 pageSize

选择 pageSize 一页显示多少天数据体验(bug);

一共10条数据. 每页显示5条, 两页可以正常分页, 当选择pageSize为15后, 只有一页数据了, 但是, 分页组件不显示分页操作元素了, 只能重新查询或者刷新页面了. 体验不好, 建议就算只有一页, 不需要隐藏.

bug 反馈

  1. 配置了infoFormat: '{start} 至 {end} 条, 共 {total} 条', 但查询数据为0的条的适合, 显示的是: 0 entires
    2.当上一次请求返回为0条数据后, 再次切换条件查询, 出现; pageNumber = -1. 并且导致页数元素高亮没有.
  2. 建议pageNumber 就从1开始, 而不是下标的概念. 服务端还得 + 1, 别扭.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.