1. #51
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    I want to but then I must make a suitable sample first. My code is a combination of a lot of tricks to get that buffered thing working with a memory store.

  2. #52
    Sencha Premium Member karlsnyder0's Avatar
    Join Date
    Mar 2010
    Location
    Maryland, USA
    Posts
    82
    Vote Rating
    12
    karlsnyder0 is on a distinguished road

      0  

    Default


    @westy

    I wrote a similar toolbar for my infinite grid and I also had to tweak the numbers to get them right. Thanks for sharing!

    Quote Originally Posted by westy View Post
    Just changed one of my grids to infinite, and quite like it.

    Had to write a little toolbar, since I like the 'Displaying 1 - 10 of 306' from the paging toolbar.
    Have also added a refresh button... looks good.

    My one concern is I seem to be able to make it hang.
    Scrolling about normally seems ok, but if grab the scroller thumb and jump massively ahead, then back to start you often end up with a loading mask that never goes away.
    No errors in Firebug.

    Will try and figure out what's going on, but suspect it's to do with a load happening whilst another is still in progress.

    This has to be rock solid, otherwise it's not an option. I love the concept though

    Cheers,
    Westy

    Edit: My bbar for anyone that's interested; obviously you'll need to sort out the refresh yourself.

    Not quite sure why the start value needs tweaking, but it's not too bad...
    Code:
            bbar: {
                items: [
                    {
                        iconCls: 'icon-refresh',
                        handler: function(button) {
                            var grid = button.up('altus-grid');
                            if (grid) {
                                grid.refreshMaintainingSelection();
                            }
                        }
                    },
                    '->',
                    {
                        xtype: 'tbtext',
                        itemId: 'lblDisplayInfo'
                    }
                ]
            },
    
    ...
    
            initComponent: function() {
                this.callParent(arguments);
    
    
                var me = this,
                    view = me.getView(),
                    toolbarDispInfo = me.down('#lblDisplayInfo'),
                    verticalScroller = me.verticalScroller,
                    store = me.getStore(),
                    updateToolbarDisplayInfo = function() {
                        var total = store.getTotalCount();
                        toolbarDispInfo.setText(Ext.String.format('Displaying {0} - {1} of {2}',
                                                                  verticalScroller.getFirstVisibleRowIndex() + 1,
                                                                  total ? Math.min(verticalScroller.getLastVisibleRowIndex(), total) : verticalScroller.getLastVisibleRowIndex(),
                                                                  total ? total : 'Unknown'));
                    };
    
    
                me.mon(
                    view,
                    'bodyscroll',
                    updateToolbarDisplayInfo);
                me.mon(
                    view,
                    'resize',
                    updateToolbarDisplayInfo);
                me.mon(
                    store,
                    'prefetch',
                    updateToolbarDisplayInfo);
            }

  3. #53
    Ext JS Premium Member
    Join Date
    Feb 2010
    Location
    Vancouver, BC
    Posts
    197
    Vote Rating
    0
    rkim is on a distinguished road

      0  

    Default


    Grouping grid is supported with infinite grid ?

    For example, Grid is grouped alphabetically by one column.

    If the first page contains A group and B group only, and when next page contains little bit of B group and C group, would infinite grid properly extend B group and create new C group header ??

  4. #54
    Sencha User
    Join Date
    Apr 2012
    Location
    SD
    Posts
    1
    Vote Rating
    0
    lancer2 is on a distinguished road

      0  

    Default


    Hi ,
    why the Buffered Grid doesn't word when i used store.loadData(somedata) after ?
    How to change the complete data of a grid panel? I tried grid.reconfigure(newStore,colModel),but lost..


    Some help??


    Thanks

  5. #55
    Sencha Premium Member karlsnyder0's Avatar
    Join Date
    Mar 2010
    Location
    Maryland, USA
    Posts
    82
    Vote Rating
    12
    karlsnyder0 is on a distinguished road

      0  

    Default


    Quote Originally Posted by rkim View Post
    Grouping grid is supported with infinite grid ?

    For example, Grid is grouped alphabetically by one column.

    If the first page contains A group and B group only, and when next page contains little bit of B group and C group, would infinite grid properly extend B group and create new C group header ??
    We use Grouping with Infinite Grid and it works great! Be sure to check out the known issues with remote grouping in some of my Forum Posts.

  6. #56
    Sencha User
    Join Date
    Mar 2009
    Location
    Reading, UK
    Posts
    33
    Vote Rating
    1
    Curtis Fletcher is on a distinguished road

      0  

    Default


    I'm having trouble maintaining scroll position over a (times) reload with the the new buffered store/grid.

    I started with this on the GridPanel:

    Code:
        reload: function () {
            var me = this;
            me.getView().saveScrollState();
            me.getStore().pageMap.clear();
            me.getStore().load({
                callback: function() {
                    me.getView().restoreScrollState();
                }
            })
        }
    But that didn't actually re-request any data from the server so I added store.clearData();

    Code:
        reload: function () {
            var me = this;
            me.getView().saveScrollState();
            me.getStore().pageMap.clear();
            me.getStore().clearData();
            me.getStore().load({
    
                callback: function() {
                    me.getView().restoreScrollState();
                }
            })
        }
    However that loads the initial pages first then loads the pages to satisfy the scrolled position so I'd like to use LoadPage() however to do this I'd need the value of store.currentPage and it doesn't seem to get set when using the grid scroller to control store loading (It remains at 1 regardless how far I scroll/which pages have been loaded by the store).

    What is the recommended way to load a (new) buffered grid at a specific scroll/page position?

  7. #57
    Sencha User
    Join Date
    Sep 2011
    Posts
    27
    Vote Rating
    0
    panpur is on a distinguished road

      0  

    Default


    Calling model.set(fieldName, newValue) generates error: "NOT_FOUND_ERR: DOM Exception 8"
    I was trying to update cell value on cellclick. It works fine on normal grid.

    Tested on 4.1 final. Is this a bug?

    Thanks
    Last edited by panpur; 30 Apr 2012 at 8:31 PM. Reason: more info

  8. #58
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    28
    Vote Rating
    2
    shmeltex is on a distinguished road

      0  

    Default


    Quote Originally Posted by panpur View Post
    Calling model.set(fieldName, newValue) generates error: "NOT_FOUND_ERR: DOM Exception 8"
    I was trying to update cell value on cellclick. It works fine on normal grid.

    Tested on 4.1 final. Is this a bug?

    Thanks
    I use model.set with buffered store with no issue. You probably hitting an edge case and will need to post code sample.

  9. #59
    Sencha User
    Join Date
    Sep 2011
    Posts
    27
    Vote Rating
    0
    panpur is on a distinguished road

      0  

    Default


    Quote Originally Posted by shmeltex View Post
    I use model.set with buffered store with no issue. You probably hitting an edge case and will need to post code sample.
    Thanks for the response. On further investigation it turns out that there's a problem on my renderer.
    Last edited by panpur; 2 May 2012 at 1:41 AM. Reason: resolved

  10. #60
    Touch Premium Member
    Join Date
    Jan 2008
    Location
    Quebec, Canada
    Posts
    128
    Vote Rating
    2
    nbourdeau is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    It would be incredibly difficult to work.

    The small subset of data in the Store might contain the last 10 rows of group A, then all of group B, then the first 10 rows of group C

    You probably would not want group A's header row to be shown. How could we not render it? The store is grouped, there's a group of "A"s, so it would put a group header in.

    So then when scrolling, and it gets re-rendered as the last 30 rows of group B, all of group C, and the first 5 rows of group D, what would the scrollTop of the table element have to be?

    It calculates the scrollTop based upon the first store row's ordinal position in the dataset. But there may be an unknown number of group headers in the mix too which change that position.

    It's all very complicated.
    Hi Animal,

    In relation to this post: http://www.sencha.com/forum/showthre...l=1#post671091

    It should be possible with only "buffered rendering" ?