Chrome 中 Extjs 中的 RTL 水平滚动条问题



我有extjs项目。 当我使用 LTR 模式或使用 FirFox 滚动条时,效果很好。但是当我使用 Chrome 时,加载数据后的滚动条会转到左侧而不是右侧。

我的 RTl 项目代码:

Ext.define('App.Application', {
extend: 'Ext.app.Application',
name: 'App',
requires: [
    'App.*',
    'Ext.rtl.*'
],
launch: function () {
    var whichView = 'mainview2';
    var elem = document.getElementById("splash");
    Ext.ariaWarn = Ext.emptyFn;
    Ext.getBody().removeCls('launching');
    elem.parentNode.removeChild(elem);
    Ext.Ajax.request({
        url: "URL",
        method: "POST",
        success: function (response, opts) {
            var result = Ext.decode(response.responseText);
            if (result.success) {
                Ext.create({
                    xtype: whichView,
                    plugins: 'viewport',
                    rtl: true,
                })
            }
        }
        }
    });
},
});

我无法完全解决此问题,但是此代码有所帮助

Ext.define("overrides.Ext.scroll.Scroller", {
override: "Ext.scroll.Scroller",
privates: {
    updateDomScrollPosition: function (silent) {
        var me = this,
            position = me.position,
            oldX = position.x,
            oldY = position.y,
            x, y, xDelta, yDelta;
        me.readPosition(position);
        x = position.x;
        y = position.y;
        me.positionDirty = false;
        if (!silent) {
            xDelta = x - oldX;
            yDelta = y - oldY;
            // If we already know about the position. then we've been coerced there by a partner
            // and that will have been firing our event sequence synchronously, so they do not
            // not need to be fire in response to the ensuing scroll event.
            if (xDelta || yDelta) {
                if (x !== oldX && x !== xDelta) {
                    if (!me.isScrolling) {
                        me.isScrolling = Ext.isScrolling = true;
                        me.fireScrollStart(x, y, xDelta, yDelta);
                    }
                    me.fireScroll(x, y, xDelta, yDelta);
                    me.onDomScrollEnd(x, y, xDelta, yDelta);
                }
            }
        }
        return position;
    },
    onPartnerScroll: function (partner, x, y, xDelta, yDelta) {
        if (x !== xDelta) {
            this.doScrollTo(x, y, false);
        // Update the known scroll position so that when it reacts to its DOM,
        // it will not register a change and so will not invoke partners.
        // All scroll intentions are propagated synchronously.
        // The ensuing multiple scroll events are then ignored.
        this.updateDomScrollPosition(true);
        // Pass the signal on immediately to all partners.
            this.fireScroll(x, y, xDelta, yDelta);
        }
    },
}
});

最新更新