目前只有一種作法,利用publish/subscribe告訴SlickGrid要去追parent的高度

$.subscribe("units/set_grid_height", function (new_height) {
    grid_opts.height = new_height;
    resize();
});

// ...

// grid = the jQuery element that represents the SlickGrid
// slick = the instantiated slickgrid
function resize() {
  grid.css('height', grid_opts.height);
  slick.resizeCanvas();
}
layout = $('body').layout({
    center: { 
        onresize: function (name, el, state, opts, layout_name) { 
            $.publish("units/set_grid_height", [state.innerHeight]);
        }
    }
});

$.publish("units/set_grid_height", [layout.state.center.innerHeight]);

Comments

comments powered by Disqus