列表高度自适应
@(Html.DevExtreme().DataGrid<project_record>()
.ID("grid")
.Height(new JS("getHeight"))
……
)
<script>
function getScreenState() {
//屏幕状态 0竖屏 ,1横屏,2未知
if (window.orientation == 0) {
return 0;
}
else if (window.orientation == 90) {
return 1;
}
return 2;
}
function getHeight() {
if (getScreenState() == 0) {
return window.innerWidth - 0.06 * window.innerWidth;
}
else if (getScreenState() == 1) {
return window.innerHeight - 0.06 * window.innerHeight;
}
else {
return window.innerHeight - 0.06 * window.innerHeight
}
}
</script>
标签:return,0.06,innerHeight,列表,DataGrid,window,系列,else From: https://www.cnblogs.com/xiaonanmu/p/17144347.html