Results 1 to 3 of 3

Thread: Ext.panel.Panel add scroll event

  1. #1

    Default Ext.panel.Panel add scroll event

    Hi All,
    how can i add the "scroll" event in Panel Component?
    I try to add it in initComponent but there isn't object on which link the event...i write this code
    Code:
    Ext.override(Ext.panel.Panel, {
     initComponent: function() {
            var me = this;
            me.addEvents(
                'beforeclose',
                'close',
                "beforeexpand",
                "beforecollapse",
                "expand",
                "collapse",
                'titlechange',
                'iconchange',
                'iconclschange',
                'scroll'
            );
      try{
       me.el.on("scroll", this.onScroll,  this);
      } catch(e){}
      
            if (me.collapsible) {
            // Save state on these two events.
                this.addStateEvents(['expand', 'collapse']);
            }
            if (me.unstyled) {
                me.setUI('plain');
            }
            if (me.frame) {
                me.setUI(me.ui + '-framed');
            }
            // Backwards compatibility
            me.bridgeToolbars();
            me.callParent();
            me.collapseDirection = me.collapseDirection || me.headerPosition || Ext.Component.DIRECTION_TOP;
            // Used to track hidden content elements during collapsed state
            me.hiddenOnCollapse = new Ext.dom.CompositeElement();
        },
     onScroll : function(event){
      ....
     }
    });
    but i receved error in
    Code:
      try{
        me.el.on("scroll", this.onScroll,  this);
       } catch(e){}
    becouse me.el is undefined.
    Where am I wrong?
    Thanks in advance for your help

  2. #2
    Sencha Premium User
    Join Date
    Mar 2011
    Posts
    287

    Default

    Not sure, but maybe you need to call me.callParent(); before trying to reference me.el.

  3. #3
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236

    Default

    me.el is unavailable until afterrender. Listen to afterrender event and then try to attach the eventlistener for 'scroll' event.

Similar Threads

  1. Scroll event of a panel!
    By arunc in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 30 Dec 2011, 6:13 AM
  2. Handle Scroll Event in Panel
    By d.albano in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 7 Apr 2011, 11:33 AM
  3. Horizontal scroll on child panel break main panel vertical scroll
    By richard_orchard in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 6 Apr 2011, 5:40 AM
  4. Can we get the scroll end event for a panel ?
    By Shijutv in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 20 Jan 2011, 7:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •