【问题标题】:get current page of paging toolbar ext js 3.4获取分页工具栏ext js 3.4的当前页面
【发布时间】:2013-02-14 08:55:44
【问题描述】:

我正在使用 EXT JS 3.4

如何获取分页工具栏的当前页面?

例如,分页工具栏显示第 7 页,共 10 页。我如何获取值“7”,因为在刷新 Grid 中的记录后我需要当前页面值。

我在 Grid 上刷新后的问题,它返回到第 1 页而不是我离开的第 7 页。

谢谢。

【问题讨论】:

    标签: extjs pagination paging extjs3


    【解决方案1】:

    仅检索活动页面(根据文档):

    // t is reference to the paging toolbar instance
    var activePage = Math.ceil((t.cursor + t.pageSize) / t.pageSize);
    

    但是如果你在做服务器端的分页,那么刷新方法已经通过游标传递到加载方法

    doRefresh : function() {
        this.doLoad(this.cursor);
    }
    

    这将填充加载选项的启动参数,您可以使用该参数和页面大小(将设置为“限制”参数)在刷新时返回正确的页面

    【讨论】:

      【解决方案2】:

      您可以使用工具栏的光标属性。 See the docs for cursor property.

      【讨论】:

        【解决方案3】:

        grid.filterXml.documentElement.setAttribute("PageNo",pageno);//设置当前页号

        grid.filterXml.documentElement.setAttribute("Start", this.cursor);//进入当前页面

        【讨论】:

          猜你喜欢
          • 2012-11-08
          • 2023-03-21
          • 2014-09-15
          • 2012-06-21
          • 2013-08-22
          • 2011-06-22
          • 2010-09-13
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多