Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Hybrid View

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    longracer is on a distinguished road

      0  

    Default Is there any way to keep scroll position of Grid on load

    Is there any way to keep scroll position of Grid on load


    I've read the previous thread "Grid Loses Selection and Scroll Position On Data Store Load" and tried the way to restore scroll position after ds.load. It works, but "However there is still a visible twitch in the grid as it scrolls to the top and then back to the restored position.", I also tried :
    Code:
    grid = new Ext.grid.Grid('guests', {
                ds: ds,
                cm: colModel,
                view: new Ext.grid.GridView({
                    focusRow: Ext.emptyFn,
                    ensureVisible: Ext.emptyFn
                })
            });
    I think the option to turn off redraw grid while only update data in it is very important requirement. The typical usage such as real time stock quotes display has to have this option, or it can't work well, obviously. So can Ext team put some effort on it?

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    24
    Vote Rating
    0
    wck555 is on a distinguished road

      0  

    Default


    It's a bit of a hack, but if you create your grid as shown below, the grid scroll position will stay where it is when the data store is reloaded. The selection remains the same as well. The onLoad() function of the grid calls scrollToTop(). By eliminating scrollToTop(), the grid no longer moves when it is reloaded. The only drawback is that you can no longer call scrollToTop() on the grid.
    Code:
    new Ext.grid.Grid('parent', {
    ...
       view: new Ext.grid.GridView({ scrollToTop: Ext.emptyFn })
    });

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    longracer is on a distinguished road

      0  

    Default scrollToTop: Ext.emptyFn works!

    scrollToTop: Ext.emptyFn works!


    Thank you, wck555, It just works as you said. Though I have to forget scrollToTop, but I got a grid without blinking

  4. #4
    Sencha - Community Support Team JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
    JeffHowden is on a distinguished road

      0  

    Default


    An alternative would be user Ext.override() to add a new method to the gridView that implements a copy of the scrollToTop() method. Then, override the built-in scrollToTop() method pointing it at the emptyFn() function, as mentioned above.

    Code:
    Ext.override(Ext.grid.GridView, {
        scrollTop : function() {
            this.scroller.dom.scrollTop = 0;
            this.scroller.dom.scrollLeft = 0;
        },
        scrollToTop : Ext.emptyFn
    });
    Now, if you need to actually scroll to the top, you call your own scrollTop() method.

    Yet another alternative is to use the override mentioned in the post above, and then simply access the gridView's scroller and call it's built-in scrollTo() method. Assuming "grid" is a variable holding a reference to your grid, you can do:

    Code:
    grid.getView().scroller.scrollTo('top', 0);
    Additionally, this approach means you can animate the scroll, if you choose:

    Code:
    grid.getView().scroller.scrollTo('top', 0, true);
    or get fancy with it:

    Code:
    grid.getView().scroller.scrollTo('top', 0, { easing: 'bounceOut' });
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

    Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.

    Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.

  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    122
    Vote Rating
    0
    cocorossello is on a distinguished road

      0  

    Default


    Thx a lot guys, just what i was looking for

  6. #6
    Ext User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    Chris_S is on a distinguished road

      0  

    Default


    I realize this thread is old, but I found my answer here and thought I'd add my solution for the next person that hits it...

    I came up with a less destructive version that I am using with 3.0:

    Code:
    Ext.override(Ext.grid.GridView, {
        holdPosition: false,
        onLoad : function(){
            if (!this.holdPosition) this.scrollToTop();
            this.holdPosition = false
        }
    });
    This way you don't have to remove the scrollToTop function and you can choose to override the scrollToTop behavior only at specific loads with something like:

    Code:
    grid.getView().holdPosition = true
    grid.getStore().reload()
    I needed this feature because I still want it to scroll to the top properly when I load with new parameters.

  7. #7
    Ext User
    Join Date
    Jul 2009
    Posts
    2
    Vote Rating
    1
    W3Design is on a distinguished road

      1  

    Default


    Quote Originally Posted by Chris_S View Post
    I realize this thread is old, but I found my answer here and thought I'd add my solution for the next person that hits it...

    I came up with a less destructive version that I am using with 3.0:

    Code:
    Ext.override(Ext.grid.GridView, {
        holdPosition: false,
        onLoad : function(){
            if (!this.holdPosition) this.scrollToTop();
            this.holdPosition = false
        }
    });
    This way you don't have to remove the scrollToTop function and you can choose to override the scrollToTop behavior only at specific loads with something like:

    Code:
    grid.getView().holdPosition = true
    grid.getStore().reload()
    I needed this feature because I still want it to scroll to the top properly when I load with new parameters.
    Thank you, your post was very helpful

  8. #8
    Sencha User
    Join Date
    Sep 2011
    Posts
    1
    Vote Rating
    0
    jhoncraigwinter is on a distinguished road

      0  

    Default


    Hi wck555 Thanks for this,because i don't have a any idea or knowledge to fixed my problems.
    The Party Boutique : Fancy Party Supplies for the elegant Party, including disposable dishes: Plates, Glasses and bowls.

  9. #9
    Sencha User
    Join Date
    Jan 2012
    Location
    Boston
    Posts
    7
    Vote Rating
    0
    chimney is on a distinguished road

      0  

    Default


    How do I achieve this in Ext GXT.? I tried overriding scrollToTop method making it do nothing, but the scroll behavior is still there. I tried setting preventScrollToTopOnRefresh to false, still doesn't work.
    Has anyone solved this for Ext GXT?

    Thanks for any suggestions.

  10. #10
    Sencha User
    Join Date
    Jun 2013
    Posts
    11
    Vote Rating
    0
    sindhu.singh is on a distinguished road

      0  

    Default


    view: new Ext.grid.GridView({ onLoad: Ext.emptyFn, //Stop Grid Refresh listeners: { beforerefresh: function (v) { v.scrollTop = v.scroller.dom.scrollTop; }, refresh: function (v) { v.scroller.dom.scrollTop = v.scrollTop; } } })use view property with the above functionality it will work fine