1. #1
    Ext User
    Join Date
    Aug 2008
    Posts
    14
    Vote Rating
    0
    pmruk is on a distinguished road

      0  

    Default Auto scroll a grid to a specific row

    Auto scroll a grid to a specific row


    Hi,

    I have a gridPanel containing an Store which includes a date column. The grid is sorted in date ascending order by default. I'd like to automatically scroll the grid to the row closest to today's date. I have found that the following both work in the FB console:

    Code:
    grid.getView().focusRow(x);
    Ext.getCmp('theGrid').getView().scroller.dom.scrollTop = y
    but I can't work out what event to listen for in order to fire one of the above. It seems that neither listening for the load event of the store or the render event on the grid work.

    I must be doing something wrong. Could someone help?

    Thanks

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Use the viewready event.

  3. #3
    Ext User
    Join Date
    Aug 2008
    Posts
    14
    Vote Rating
    0
    pmruk is on a distinguished road

      0  

    Default


    OK, listen for 'viewready' on the GridPanel; makes sense except I can't get it to fire. I'm using version 2.2.1 and although I can find it in the 3.1 docs it doesn't appear under the GridPanel class in the 2.2.1 docs. Is it actually implemented in 2.2.1? Or is there something wrong with my implementation?
    Code:
    var mygrid = new Ext.grid.GridPanel({
        store      : this.store,
        height     : 300,
        width      : 500,
        stripeRows : true,
        listeners  : {
             viewready: function(grid){
                 console.log(grid);
            }
        }
    });
    Thanks

  4. #4
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Please post in the *help* section in the future with these types of questions.

    Moved to help.

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It's a 3.* event

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi