开发者

resize jqgrid when parent div changes with an event

I have a dashboard with several jqgrids. My dashboard windows can individually expand to fill up the page while all other windows disa开发者_StackOverflowpear. There is also a toggle to shrink back

If i have a jqgrid, in that window, when it expands I would like the grid width to expand and shrink a as well.

Is there some way to bind the grid to its parent div so it can expand and shrink?

Sample so far which does not work.

$('.portlet-content').bind('resize', function() {
        jQuery("#gridConfirm").setGridWidth($('.portlet-content').width()-5, true);
    }).trigger('resize'); 


You should bind jQuery.resize to the window object. Try this one

$(window).resize(function() {
    $("#gridConfirm").jqGrid('setGridWidth', $('.portlet-content').width()-5, true);
}).trigger('resize');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜