【问题标题】:Hide Text on scrolling down bottom of the page, Sencha 3 ExtJS向下滚动页面底部时隐藏文本,Sencha 3 ExtJS
【发布时间】:2016-04-01 19:03:11
【问题描述】:

我正在向条款和条件网页添加一个文本“请向下滚动”,该文本应该在到达页面底部后隐藏。我创建了一个容器,在 View (Sencha Architect) 下显示整个页面上的文本,但不确定滚动到底部后如何隐藏它。我正在尝试在 Controllers 下创建一个控制器操作,但它不起作用。附件是条款条件控制器的代码。包含文本的容器的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();
           },

【问题讨论】:

    标签: extjs


    【解决方案1】:

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

    在面板页面,我有

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-02
      • 2021-11-21
      • 1970-01-01
      • 1970-01-01
      • 2019-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多