Results 1 to 3 of 3

Thread: infinite scroll grid height

  1. #1
    Sencha User
    Join Date
    Aug 2007
    Posts
    10
    Vote Rating
    2
      1  

    Default 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
    9,389
    Answers
    716
    Vote Rating
    497
      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
    115
    Answers
    2
    Vote Rating
    28
      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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •