1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    101
    Vote Rating
    0
    paulharv is on a distinguished road

      0  

    Default GridPanel not rendering correctly

    GridPanel not rendering correctly


    I'm using EditorGridPanels on dynamically generated web pages. ExtJS does not control the ViewPort.

    When I wrap the Grid generation code in Ext.onReady(), the grids render perfectly.
    If I do not wrap it in Ext.onReady() it renders with subtle layout issues like
    • the grids are a little too wide
    • the top toolbar gets cut off on the right
    • the rows don't quite fit and they shift when clicking a cell
    I have tried forcing the grids' layout to get recalculated once the page loads...

    Code:
    
    (function(){}
       var grid = ...
       [ ... ]
       Ext.onReady(function(){
          grid.doLayout();
       });
    )();
    The reason I'm trying to avoid placing Grid initialization inside Ext.onReady() is that sometimes pages take a long time to fully load every resource, and in these cases the pages look fully loaded apart from the blank spaces where the grids eventually get rendered to!

    Any suggestions on what I might try? Right now a complete redesign of the page is not in scope, so I'm looking for something I can do to get the grid to layout like it does when initialized inside onReady()!

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to wait for onReady to fire, that lets you know when all javascript and CSS and everything have been loaded.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread