RTL horizontal Scrollbar Problem in Extjs in Chrome

て烟熏妆下的殇ゞ 提交于 2021-01-29 08:00:53

问题


I have extjs project. when I use LTR Mode OR use FirFox scroll bar work well. but when I use Chrome, scrollbar after load data goes to left side instead of right side.

My Code For RTl Project:

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,
                })
            }
        }
        }
    });
},
});

回答1:


I wasn't able to completely resolve this Issue, but this code Helped a little

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);
        }
    },
}

});


来源:https://stackoverflow.com/questions/57019628/rtl-horizontal-scrollbar-problem-in-extjs-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!