使用sencha架构师extjs获取滚动位置

时间:2015-06-28 19:21:23

标签: extjs scroll

我一直在尝试使用sencha架构师获取树网格的滚动位置和ext.js应用程序。最初我想在重新加载后保持滚动位置,所以当用户删除帖子后,它会在重新加载后滚动回到同一个位置。我试图使用我搜索过的各种方法,但没有任何工作。我正在测试有一个java脚本超时函数给我几秒后的滚动位置,足够让我向下滚动和console.log的位置,但它没有给我什么,我没有显示任何东西,但是当时我进入dom并查看树视图对象。我已经尝试了以下

1st: var newcompheight = comboboxeample.getHeight();

2nd:  getScroll: function() {
    var me = this,
        dom = me.dom,
        doc = document,
        body = doc.body,
        docElement = doc.documentElement,
        left, top;

    if (dom === doc || dom === body) {
        // the scrollLeft/scrollTop may be either on the body or documentElement,
        // depending on browser. It is possible to use window.pageXOffset/pageYOffset
        // in most modern browsers but this complicates things when in rtl mode because
        // pageXOffset does not always behave the same as scrollLeft when direction is
        // rtl. (e.g. pageXOffset can be an offset from the right, while scrollLeft
        // is offset from the left, one can be positive and the other negative, etc.)
        // To avoid adding an extra layer of feature detection in rtl mode to deal with
        // these differences, it's best just to always use scrollLeft/scrollTop
        left = docElement.scrollLeft || (body ? body.scrollLeft : 0);
        top = docElement.scrollTop || (body ? body.scrollTop : 0);
    } else {
        left = dom.scrollLeft;
        top = dom.scrollTop;
    }

    return {
        left: left,
        top: top
    };

3rd: var test = window.pageYOffset;

我还试图将Sencha架构师中的keepscroll位置属性设置为true,其他东西我用Google搜索但没有任何工作。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

使用此:

<Connector port="8443" maxThreads="500"
           server="Apache"
           scheme="https" secure="true" SSLEnabled="true" acceptCount="500"
           keystoreFile="/apps/content/certificates/keystore.ks" keystorePass="keystorepass"
           truststoreFile="/apps/content/certificates/truststore.ks" truststorePass="truststorePassword"/>