Chrome中的Extjs中的RTL水平滚动条问题 [英] RTL horizontal Scrollbar Problem in Extjs in Chrome

查看:59
本文介绍了Chrome中的Extjs中的RTL水平滚动条问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

推荐答案

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

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

});

这篇关于Chrome中的Extjs中的RTL水平滚动条问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆