0
votes

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...

(function(){}
   var grid = ...
   [ ... ]
   Ext.onReady(function(){
      grid.doLayout();
   });
)();

...but this does not work.

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

1

1 Answers

0
votes

You could perhaps mask the page initially with 'loading..' message and remove this in the onReady().

If you're getting issue outside of on the onReady it would indicate something has not loaded when you're trying to render components, this in my experience will lead to further issues down the line.