开发者

resize jqgrid when parent div changes with an event

开发者 https://www.devze.com 2023-04-11 18:38 出处:网络
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

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

精彩评论

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