EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: JeroenvdV on May 26, 2022, 01:23:28 AM



Title: Set Drawer height to '100%' explicitly to make fit:true of inner Layout to work
Post by: JeroenvdV on May 26, 2022, 01:23:28 AM
Hi,

For those using a Layout inside the Drawer, make sure to set the height property of the Drawer to 100% if you want the Layout to fit the Drawer's dimensions. Without doing that the Layout div's height becomes 1px even when you set its fit property to true.

Code:
<div id="drawer-additional-info" class="easyui-drawer" data-options="width:475,height:'100%'" >
    <div class="easyui-layout" data-options="fit:true">
        <div region="north" data-options="border:false,title:'Comments',collapsible:false" style="height:400px;">
             Some text...
        </div>
        <div region="center" data-options="border:false">
             Some text...
        </div>
    </div>
</div>


Title: Re: Set Drawer height to '100%' explicitly to make fit:true of inner Layout to work
Post by: jarry on May 27, 2022, 08:23:08 AM
If possible please call the 'resize' method after expanding it.
Code:
$('#drawer-additional-info').drawer({
onExpand: function(){
$(this).drawer('resize')
}
})


Title: Re: Set Drawer height to '100%' explicitly to make fit:true of inner Layout to work
Post by: JeroenvdV on May 28, 2022, 12:24:03 PM
Thanks Jarry, that works too! :)