Results 1 to 5 of 5

Thread: Scroll Events in TouchGridPanel

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    The Hague, The Netherlands.
    Posts
    11
    Vote Rating
    0
      0  

    Default Scroll Events in TouchGridPanel

    Hi ,

    I wanted to capture "Scroll" event of the TouchGridPanel.

    Any ideas, pointers for the same?

    My requirement is to make 1st column of grid freeze. So am trying to put 1 list and touchGridPanel in a Panel.
    Now I have captured scroll event of the list and accordingly setting offset for the Grid as well.

    rptList.scroller.on('scroll', scrollGrid);

    But vice-versa for the grid is not working.. i.e when am scrolling grid, the function is not getting called.
    grid.scroller.on('scroll', scrollList);

    Please advice.

    Thanks in advance.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    All the TouchGridPanel is is a Panel with a DataView. So get the scroller on the dataview and listen to it's events.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Vote Rating
    1
      0  

    Default

    Hi,
    I am trying to capture Scroll event on TouchGridPanel .

    As per suggestion, I did the following code but on scroll
    it is not at all coming to
    startScroll function.
    neither it is giving any error.

    Could you please point out the mistake or any pointer. Thanks in advance.


    Code:
    Ext.ux.TouchGridPanel = Ext.extend(Ext.Panel, {
        layout        : "fit",
         multiSelect   : false,
        scroll        : "both",
    
        initComponent : function() {
            var me = this;
            me.items = me.dataview = me.buildDataView();
    
            if (!Ext.isArray(me.dockedItems)) {
                me.dockedItems = [];
            }
             me.header = new Ext.Component(me.buildHeader());
            me.dockedItems.push(me.header);
    
            Ext.ux.TouchGridPanel.superclass.initComponent.call(me);
    
            var store = me.store;
             store.on("update", me.dispatchDataChanged, me);
    
             var dataview = me.dataview;        
            dataview.on("scroll", me.startScroll, me);
    
        },
    
    startScroll: function (scroller, offset) {
            console.log('is this event captured???')
            var me = this;
    
    
            me.fireEvent("scroll", this.scroller, offset);
        },

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Vote Rating
    1
      0  

    Default

    Hi

    Update to previous post.

    I guess, can listen to scroll event only after data loaded.
    before that var scroller = me.dataview.scroller; is always NULL.

    I tried to get the scroller after the grid data loaded.

    i.e @ where am displaying grid
    Code:
     
     var grid1 = new Ext.ux.TouchGridPanel({
    ....
    
     gridStore.on('load', function() {    
       grid1.scroller.on('scroll', function(){               console.log('is this event captured???');
                });
    }
    But still am not able to capture scroll event when i scroll Grid.

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Vote Rating
    1
      0  

    Default

    Hi,

    just to update, i managed to scroll the grids.

Tags for this Thread

Posting Permissions

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