1. #21
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default


    this is how my view config looks like :


    Code:
    viewConfig: {
            columnLines : true,
            loadingText : undefined,
            loadMask : false,
            preserveScrollOnRefresh : true,
            onStoreLoad: Ext.emptyFn
        },
    but it didnt worked I put empyfn to in veiwconfig but no sucess then as a last resort this worked :

    Code:
    grid.load(function(){
    grid.getEl().down('.x-grid-view').scrollTo('top', prev_scrollPosition, false);
    })
    EXT Js Developer

  2. #22
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    1
    nchcarlos is on a distinguished road

      0  

    Default


    ...strange. Check out the doc. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.View-cfg-preserveScrollOnRefresh
    Glad to see you've got it working though.

  3. #23
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    18
    Vote Rating
    0
    EESW is on a distinguished road

      0  

    Default


    "preserveScrollOnRefresh: true" works for me in 4.1, except in Chrome. Anyone else see this behavior?



  4. #24
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default


    I used it too, but it didn't worked for me in any browser that's why I manually displaced scroller to prev_location on "Load(callback(prev_location))"

    did you tried on IE 8~9 I wonder why it has different output for different developers, may be because the approach used by every developers is different!

    Quote Originally Posted by EESW View Post
    "preserveScrollOnRefresh: true" works for me in 4.1, except in Chrome. Anyone else see this behavior?

    EXT Js Developer

  5. #25
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    18
    Vote Rating
    0
    EESW is on a distinguished road

      0  

    Default


    Thanks for the reply, waqer. I agree that it could be related to different implementations. We are using MVC and doing a reconfigure on the grid. Works for us in IE9 and Firefox. Only seeing a problem in Chrome. We actually have two grids inside different panels in a ViewPort. Strange, I just noticed the scroll bar only resets in one of the grids! Going to have to look more closely at the View definitions!

  6. #26
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default


    ok, I hope you get hold of actual reason why same component behaving differently on similar situations...

    Do share with us too..

    Thanx in Advance!

    Quote Originally Posted by EESW View Post
    Thanks for the reply, waqer. I agree that it could be related to different implementations. We are using MVC and doing a reconfigure on the grid. Works for us in IE9 and Firefox. Only seeing a problem in Chrome. We actually have two grids inside different panels in a ViewPort. Strange, I just noticed the scroll bar only resets in one of the grids! Going to have to look more closely at the View definitions!
    EXT Js Developer

  7. #27
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    3
    Vote Rating
    1
    ahdavis is on a distinguished road

      1  

    Default To preserve scroll position in Ext.tree.Panel

    To preserve scroll position in Ext.tree.Panel


    I'm using ExtJS 4.1.1 and was trying to preserve the scroll position of Ext.tree.Panel and
    Code:
    viewConfig:{    "preserveScrollOnRefresh: true"
    did not work for me, but the following did and I imagine it would work for a normal grid as well:

    1. Created a global var:

    Code:
    var scrollPosition = 0;
    2. Before my grid reload:

    Code:
    scrollPosition = treePanel.getEl().down('.x-grid-view').getScroll();
    3. In my load event handler for my Ext.data.TreeStore:

    Code:
    if( scrollPosition != 0 ) {
        schedTree.getView().scrollBy( 0, scrollPosition.top, false );
    }

  8. #28
    Sencha User
    Join Date
    Sep 2012
    Posts
    1
    Vote Rating
    0
    Nick_Kourpan is on a distinguished road

      0  

    Default Create Ext.grid.Panel with remote DB scrolled to given element

    Create Ext.grid.Panel with remote DB scrolled to given element


    How I can create Ext.grid.Panel with remote DB scrolled not to top? Ext 4.1.1.

    This is fragment of my Ext.grid.Panel config:
    Code:
                viewConfig: {
                    trackOver: false,
                    preserveScrollOnRefresh: true,
                },
                listeners: {
                    viewready: function() {
                            this.getView().scrollState.top=300;
                            this.getView().restoreScrollState();
    //                        this.getView().focusRow(30);
                    }
                },
    If I set a breakpoint, then after it both variants (restoreScrollState or focusRow) works fine. But in realtime they don't works. How can I do this?

  9. #29
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
    5ukwzx is on a distinguished road

      0  

    Default


    Quote Originally Posted by jedstark View Post
    I found this accidentally, since it's not listed in the API for 4.0, but it's what we're looking for:
    Code:
    invalidateScrollerOnRefresh: false,
    Just toss that onto your grid configuration and it should be good to go. Works for my purposes.

    Makes me wonder what other gems are hidden in the code and aren't displayed in the API?
    It was useful thank you

  10. #30
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    In EXTJS 4.2.1 this property has been renamed to
    Code:
    preserveScrollOnRefresh
    .