dojo - How to launch GridX column width recalculation after the grid has been started up? -


according documentation:

https://github.com/oria/gridx/wiki/create-the-simplest-gridx

never forget call grid.startup(), since column width calculation , layout rendering need access geometry information of grid dom nodes.

if have grid columns, have no width specified, , autowidth set false, startup() calculates size of columns so, fill whole viewport horizontally. however, if viewport expanded, , empty space inserted after last column. if viewport narrowed, last columns not more visible (and no scroll rendered).

so think best workaround launch recalculation of columns sizes manually, after viewport resized. can't find api method that.

how call column width recalculation , layout rendering on existing grid?

what i've done situation setup event handler watch window resize events, set width current grid width. when creating grid:

function _resizetowindow(grid, gridid) {   grid.resize({w: dom.byid(gridid).offsetwidth, h: undefined}); }  on(window, "resize", function() {   _resizetowindow(grid, gridid); }); 

it looks little odd resize grid current width of grid, calling function cause grid rendered again appropriate column widths new grid width.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -