在页面底部向下滚动隐藏文本,Sencha 3 ExtJS

时间:2016-04-01 19:03:12

标签: extjs

我正在添加文字"请向下滚动"到条款和条件网页,文本应在到达页面底部后隐藏。我创建了一个容器,在View(Sencha Architect)下显示整个页面上的文本但不确定如何在滚动到底部后隐藏它。我正在尝试在控制器下创建一个控制器操作,但它不起作用。附件是TermsConditions控制器的代码。包含文本的容器的ItemID是scrollContainer

onAgreeClick: function(button, e, eOpts) {
        var store = Ext.data.StoreManager.lookup('UserObjectStore');
        var match = store.first(),
            showAnnouncements = match.get('announcementPageToVisit');
        if (showAnnouncements) {
            button = this.getBtnAnnouncements();
        } else {
            button = this.getBtnCustomerSearch();
        }
        this.simulateHeaderButtonClick(button);

        Ext.Ajax.request({
            url: '../abc/services/users/saveUser',
            method: 'GET',
            headers: { 'Content-Type': 'application/json' },
            success: function (response, action) {

            },
            failure: function (response, action) {

            }
        });
    },
onDisagreeClick: function(button, e, eOpts) {
        Ext.Msg.confirm('','You must agree to the Terms and Conditions in order to continue. Press YES to go back or NO to exit.',
            function(answer) {
                if (answer === "no") {
                    var h = abc.app.getController('HeaderButton');
                    h.terminateApp('ok', null, null);
                }
            }
        );
    },
 BackToTaC: function(button, e, eOpts) {
        this.getTermsBtnContainer().hide();
        this.getTermsBackContainer().show();
        this.getScrollContainer().hide();
        this.getBtnAnnouncements().toggle();
        this.getBody().getLayout().setActiveItem(6);
    },
var me = this;
dataview.getEl().on('scroll', function(e, t) {
    if(t.scrollHeight - t.scrollTop - t.clientHeight === 0) {
    }

});// I already tried to hide under this but it doesn't work
  onTermsBeforeShow: function(component, eOpts) {
        var me = this;
        var termsView = component.down('dataview');
        var termsStore = termsView.getStore();
        termsStore.getProxy().actionMethods = {create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'};
        termsStore.load();
           },

1 个答案:

答案 0 :(得分:0)

我对Extjs Panel有类似的要求,我通过获取网格的高度并将高度与网格的当前Y位置进行比较来处理它们。

在面板页面中,我有

var toBeAbsoluted = this.getHeight() / 95 * 100; // approximation 95% seemed optimum in my case
if(this.getY() >= (this.getHeight() - toBeAbsoluted ))
buttonToHide.hide()