Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 如何覆盖pagingtoolbar?_Extjs_Extjs4 - Fatal编程技术网

Extjs 如何覆盖pagingtoolbar?

Extjs 如何覆盖pagingtoolbar?,extjs,extjs4,Extjs,Extjs4,我想知道如何覆盖分页工具栏的displaymsg和页码 我试图让分页工具栏与无限滚动一起工作。我已经让组件工作,这样当用户移动无限垂直滚动条时,我就可以使用javascript计算出我们在哪个页面上,并且我想用这个数字更新分页工具栏。类似地,我计算出用户在哪个记录范围内,并希望用这个范围更新displaymsg 我可以修改html以直接更改displaymsg,但我更愿意更改这些{0}、{1}、{2}变量: "Displaying {0}-{1} of {2} Item(s)" 有什么商店可以

我想知道如何覆盖分页工具栏的displaymsg和页码

我试图让分页工具栏与无限滚动一起工作。我已经让组件工作,这样当用户移动无限垂直滚动条时,我就可以使用javascript计算出我们在哪个页面上,并且我想用这个数字更新分页工具栏。类似地,我计算出用户在哪个记录范围内,并希望用这个范围更新displaymsg

我可以修改html以直接更改displaymsg,但我更愿意更改这些{0}、{1}、{2}变量:

"Displaying {0}-{1} of {2} Item(s)"
有什么商店可以帮我换吗

我不知道页码是否在存储中,如果不是,我可以直接编辑html来更改它,而不必担心冲突

有什么想法或技巧可以让我做到这一点吗?谢谢。

看看资料来源

有一种方法

// private
    updateInfo : function(){
        var me = this,
            displayItem = me.child('#displayItem'),
            store = me.store,
            pageData = me.getPageData(),
            count, msg;

        if (displayItem) {
            count = store.getCount();
            if (count === 0) {
                msg = me.emptyMsg;
            } else {
                msg = Ext.String.format(
                    me.displayMsg,
                    pageData.fromRecord,
                    pageData.toRecord,
                    pageData.total
                );
            }
            displayItem.setText(msg);
            me.doComponentLayout();
        }
    },
也许你可以为这样的东西开发一个公共接口

干杯。:)

看看资料来源

有一种方法

// private
    updateInfo : function(){
        var me = this,
            displayItem = me.child('#displayItem'),
            store = me.store,
            pageData = me.getPageData(),
            count, msg;

        if (displayItem) {
            count = store.getCount();
            if (count === 0) {
                msg = me.emptyMsg;
            } else {
                msg = Ext.String.format(
                    me.displayMsg,
                    pageData.fromRecord,
                    pageData.toRecord,
                    pageData.total
                );
            }
            displayItem.setText(msg);
            me.doComponentLayout();
        }
    },
也许你可以为这样的东西开发一个公共接口

干杯。:)


谢谢你。这会改变displaymsg,你知道怎么改变吗 文本框中的页码是多少

你可以自己生成它

所以。。。创建一些公共方法-

refreshDisplayMsg(from, to, total) {
    var me = this, 
    displayItem = me.child('#displayItem'),
    msg = Ext.String.format(
                    me.displayMsg,
                    from
                    to,
                    total
    );
    displayItem.setText(msg);
    me.doComponentLayout();
}
此外,store onload hanlder将调用此方法


谢谢你。这会改变displaymsg,你知道怎么改变吗 文本框中的页码是多少

你可以自己生成它

所以。。。创建一些公共方法-

refreshDisplayMsg(from, to, total) {
    var me = this, 
    displayItem = me.child('#displayItem'),
    msg = Ext.String.format(
                    me.displayMsg,
                    from
                    to,
                    total
    );
    displayItem.setText(msg);
    me.doComponentLayout();
}

此外,store onload hanlder将调用此方法。

。这会更改displaymsg,知道如何更改文本框中的页码吗?谢谢。这会更改displaymsg,您知道如何更改文本框中的页码吗?下次扩展您的答案时,请编辑它以添加更多信息。谢谢您的答案,但我已经解决了这个问题,我指的是页码…下次扩展您的答案时,请编辑它以添加更多信息。感谢您的答案,但我已经解决了,我指的是页码。。。