1. #1
    Sencha User
    Join Date
    Aug 2007
    Posts
    10
    Vote Rating
    1
    richard.allen is on a distinguished road

      1  

    Default Unanswered: infinite scroll grid height

    Unanswered: infinite scroll grid height


    Is there a way to have the height of an infinite scroll grid shrink to fit the number of rows when the store returns fewer records than would be required to fill the configured height?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    7,185
    Vote Rating
    194
    Answers
    433
    scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold scottmartin is a splendid one to behold

      1  

    Default


    Not that I am aware of. I have used the following in previous apps, perhaps it may help:

    Code:
    // call on grid.afterlayout / resize
    
        calculatePageSize: function() {
            if (!this.rendered) { return false; }
    
            var row = this.view.getRow(0);
            var rowHeight;
    
            if (!row) { rowHeight = 41; }
            else { rowHeight = Ext.get(row).getHeight(); }
    
            var height = this.getView().scroller.getHeight();
    
            var ps = Math.floor(height / rowHeight);
            return (ps > 1 ? ps : false);
        },
    Regards,
    Scott.

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2008
    Posts
    96
    Vote Rating
    6
    Answers
    1
    KajaSheen is on a distinguished road

      1  

    Default


    I have the same problem. And searching for a solution.

    @Scott, it seems that your code is Ext 3.x, the functions you are using are not available anymore. If someone has a tip on how to access a row EL from the view I guess one could reuse your code, but I couldn't see a way to do it. Dom-Query perhaps?