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

天大地大妈咪最大 提交于 2019-12-04 18:27:25

What I've done for this situation is setup an event handler to watch for window resize events, then set the width to the current grid width. When creating the grid:

function _resizeToWindow(grid, gridId) {
  grid.resize({w: dom.byId(gridId).offsetWidth, h: undefined});
}

on(window, "resize", function() {
  _resizeToWindow(grid, gridId);
});

It looks a little odd to resize the grid to the current width of the grid, but calling that function will cause the grid to be rendered again with appropriate column widths for the new grid width.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!