JS动态设置EasyUI Panel和DEV ASPxGridView的高度的方法:
方法一:在页面加载时
var setheight = Math.max(0, document.documentElement.clientHeight / 2-50);
$('#zxsj_win').panel('resize', {
height: setheight
});
$('#ywsj_win').panel('resize', {
height: setheight
});
//页面加载时设置表格高度,注意DEV ASPxGridView 的高度与VerticalScrollableHeight的属性设置无关只要设置ASPxGridView1.SetHeight()即可。
ASPxGridView1.SetHeight(setheight);
ASPxGridView2.SetHeight(setheight);
方法二:在表格加载时设置
function OnInit(s, e) {
AdjustSize();
}
function OnEndCallback(s, e) {
AdjustSize();
}
function AdjustSize() {
var height = Math.max(0, document.documentElement.clientHeight / 2-50 );
ASPxGridView1.SetHeight(height);
ASPxGridView2.SetHeight(height);
}
ASPxGridView的重要设置:
<Settings ShowFilterBar="Hidden" ShowFilterRowMenuLikeItem="False" ShowFooter="False" ShowGroupPanel="False" ShowFilterRow="False" ShowFilterRowMenu="False" VerticalScrollableHeight="100" EnableFilterControlPopupMenuScrolling="True" HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Auto" ShowHeaderFilterButton="True" />
最重要的地方是ASPxGridView的 VerticalScrollBarMode=“Auto”,一定要这样设置才有效!