简体   繁体   English

Extjs 经典网格面板滚动

[英]Extjs classic grid panel scroll

Extjs 6.2.0 Extjs 6.2.0

Have this panel有这个面板

Ext.create('Ext.grid.Panel', {
                    region: 'center',
                    padding: 5,
                    reserveScrollbar: false,
                    scrollable: true,
                    columnLines: false,
                    rowLines: false,
                    disableSelection: true,
                    viewConfig: {
                        stripeRows: false,
                        trackOver: false,
                        preserveScrollOnRefresh: true
                    },
                    store: 'chatmessagesstore',
                    hideHeaders: true,
.....

and one column with renderer和一列带渲染器

Grid in the Ext.form.Panel with layout border.带有布局边框的 Ext.form.Panel 中的网格。 And Ext.form.Panel in window with layout FIT.和窗口中的 Ext.form.Panel 布局适合。 Store is MemoryStore Store 是 MemoryStore

I add record to store and then it showing in grid.我将记录添加到存储中,然后将其显示在网格中。 But if i add more then 50 record to store i see blank space at the buttom of grid.但是如果我添加超过 50 条记录来存储,我会在网格底部看到空白区域。 In last Chrome I see blank space.在最后一个 Chrome 中,我看到了空白。 In last "Sputnik" browser (Russian) I do not see blank space在上一个“人造卫星”浏览器(俄语)中,我看不到空格

I think that it's wrong scrollbar calculation.我认为这是错误的滚动条计算。 But how to solve?但是怎么解决呢? My head is broken )我的头坏了)

set bufferedRenderer property to false in your grid..在您的网格中将 bufferedRenderer 属性设置为 false ..

...
...
/**
 * Create chat box
 *
 * @return {Ext.grid.Panel}
 */
createChatBox: function () {
    var me = this;
    if (!me.chatBox) {
        console.log('creating');
        this.chatBox = Ext.create('Ext.grid.Panel', {
            region: 'center',
            padding: 5,
            reserveScrollbar: false,
            scrollable: true,
            columnLines: false,
            rowLines: false,
            disableSelection: true,
            bufferedRenderer: false, // SET IT TO FALSE
            viewConfig: {
                stripeRows: false,
                trackOver: false,
                preserveScrollOnRefresh: true
            },
            store: 'chatmessagesstore',
            hideHeaders: true,
            columns: [{
...
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM