easyui设置界面的高度自适应
单独设置界面中特定region区时,高度自适应失败;设置整个界面时成功。实现代码在script块中,具体代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="add_material.aspx.cs" Inherits="Truelore.Fare.Web.add_material" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" type="text/css" href="jquery-easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="jquery-easyui/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="css/default.css"/>
<script type="text/javascript" src="jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui/jquery.easyui.min.js"></script> <style type="text/css"> body{
position: relative;
left: %;
width: %;
} .line {
height:32px;
} </style> <script type="text/javascript">
$(function () {
$('#_content').layout();
setHeight();
});
function setHeight() {
var c = $('#_content');
var p = c.layout('panel', 'center'); // get the center panel
var oldHeight = p.panel('panel').outerHeight();
p.panel('resize', { height: 'auto' });
var newHeight = p.panel('panel').outerHeight();
c.layout('resize', {
height: (c.height() + newHeight - oldHeight)
});
}
</script> </head>
<body>
<div id="_content" class = "easyui-panel">
<div style="height:240px">
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'west'" style="width:60%">
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>材料编码:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true" >
<span>(自动生成)</span>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>材料名称:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true">
<input class="easyui-textbox" style="width:75%;" value ="xxxxx"/>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%" >
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>规格型号:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true">
<input class="textbox easyui-textbox" style="width:75%;" value ="xx"/>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>单位:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true" >
<input class="easyui-textbox" style="width:75%" value ="m"/>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>预算价:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true" >
<input class="easyui-textbox" style="width:75%" value =""/>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>市场价:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true" >
<input class="easyui-textbox none-border" style="width:75%" value =""/>
</div>
</div>
</div>
<div class = "easyui-panel bottom-border" style="width:100%">
<div style="float:left;width:30%;text-align:center">
<div class = "easyui-panel line none-border" style="text-align:center;">
<span>归属章节:</span>
</div>
</div>
<div style="float:left;width:70%">
<div class = "easyui-panel line left-border" data-options="fit:true" style="text-align:center">
<a href='#' class='easyui-linkbutton' style="margin:2px 15px" >选择</a>
<a href='#' class='easyui-linkbutton' style="margin:2px 15px" >新建</a>
</div>
</div>
</div>
</div>
<div data-options="region:'east'" style="width:40%">
<div class="easyui-panel none-border" style="padding:5px;" >
<ul class="easyui-tree" data-options="url:'jsons/add_material_tree.json',method:'get',animate:true" style="border:none"></ul>
</div>
</div>
</div>
</div>
<div class = "easyui-panel line none-border" >
<a href='#' class='easyui-linkbutton' style="margin:2px" >导入Excel</a>
</div>
<div style="height:100%;">
<div data-options="region:'center'">
<table id = "_dg_json" class="easyui-datagrid none-border" data-options="rownumbers:true,singleSelect:true,collapsible:true,url:'jsons/add_material_datagrid.json',method:'get'" >
<thead>
<tr>
<th data-options="field:'code',width:'20%',align:'center'">材料编码</th>
<th data-options="field:'name',width:'20%',align:'center'">材料名称</th>
<th data-options="field:'type',width:'8%',align:'center'">规格型号</th>
<th data-options="field:'uinit',width:'8%',align:'center'">单位</th>
<th data-options="field:'budgetary_price',width:'20%',align:'center'">预算价</th>
<th data-options="field:'market_price',width:'20%',align:'center'">市场价</th>
</tr>
</thead>
</table>
</div>
<div data-options="region:'south'" style="height:50px;">
<div style ="width:100%;text-align:center">
<a href='#' class='easyui-linkbutton' style="margin:10px 25px" >保存</a>
<a href='#' class='easyui-linkbutton' style="margin:10px 25px" >取消</a>
</div>
</div>
</div>
</div>
</body>
</html>
easyui设置界面的高度自适应的更多相关文章
- EasyUI combobox 下拉高度自适应
要指出的是,combobox是继承自combo的,所以,combo的属性也可以被combobox使用,该问题也是这样产生的,知道这个原理,该问题就解决一半了,另一点要指出的是,在easyui中,num ...
- 如何使easyui的datagrid 高度自适应
如何使easyui的datagrid 高度自适应? 最开始使用easyui的datagrid加载数据时,对其设置的高度都是固定值,数据较多时table表现为滚动条形式.某天,老大突然需要datagri ...
- WPF设置DataGrid行内容高度自适应 与 TextBox/TextBlock内容高度自适应
WPF设置DataGrid行内容高度自适应 TextBox/TextBlock内容高度自适应 参考: DataGrid 控件中的调整大小选项: http://msdn.microsoft.com/ ...
- 父容器根据子容器高度自适应:设置父容器 height:100%;overflow:hidden;
父容器根据子容器高度自适应:设置父容器 height:100%;overflow:hidden;
- android设置GridView高度自适应,实现全屏铺满效果
使GridView每个item的高度自适应拉伸,达到整个GridView刚好铺满全屏的效果. public static void setGridViewMatchParent(GridView gr ...
- 关于UIWebView设置高度自适应的问题
- (void)viewDidLoad { [super viewDidLoad]; _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMa ...
- 如何设置iframe高度自适应,在跨域的情况下能做到吗?
在页面上使用iframe来动态加载页面内容是网页开发中比较常见的方法.在父页面中给定一个不带滚动条的iframe,然后对属性src指定一个可加载的页面,这样当父页面被访问的时候,子页面可以被自动加载. ...
- [Asp.Net Core] - 设置 Syncfusion / RichTextEditor 移除超链接及高度自适应 的方法
背景 使用 Syncfusion / RichTextEditor 对录入后的信息进行展示:1. 希望内容高度自适应.2. 希望禁用原文中的超链接. 实现 <div class=" ...
- css高度自适应
何为高度自适应? 高度自适应就是高度能跟随浏览器窗口的大小改变而改变,典型的运用在一些后台界面中上面一栏高度固定用作菜单栏或导航栏,下面一栏高度自适应用于显示内容.高度自适应不像宽度自适应那样简单,在 ...
随机推荐
- HQL的语言
HQL: 是Hibernate Query Language的缩写 1.HQL查询 特点: 与SQL相似,SQL中的语法基本上都可以直接使用 SQL查询的是表和表中的列而HQL查询的是对象或者对象中的 ...
- iOS UICollectionView之三(基本用法)
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @pr ...
- MYBATIS报ORA-01745: 无效的主机/绑定变量名 异常
异常:Cause: java.sql.SQLSyntaxErrorException: ORA-01745: 无效的主机/绑定变量名 原因,sql语句中,两个填充变量间没有写逗号.
- Swift语言实战晋级-第9章 游戏实战-跑酷熊猫-3 显示一个动态的熊猫
一个静态的熊猫明显不能满足我们的欲望,接下来我们就让熊猫跑起来.序列帧动画的原理就是不停的切换不同的图片.当我们将一张一张的切换Panda类的跑动文理后,熊猫就跑起来了.那么首先我们需要一个数组常量来 ...
- PostgreSQL trigger (function) examples
postgres=# \c warehouse_db You are now connected to database "warehouse_db" as user " ...
- SQL 数据库备、还,附、分,数据查询,聚合函数
认识数据库备份和事务日志备份 数据库备份与日志备份是数据库维护的日常工作,备份的目的是在于当数据库出现故障或者遭到破坏时可以根据备份的数据库及事务日志文件还原到最近的时间点将损失降到最低点. 数据库备 ...
- HUD 5086 Revenge of Segment Tree(递推)
http://acm.hdu.edu.cn/showproblem.php?pid=5086 题目大意: 给定一个序列,求这个序列的子序列的和,再求所有子序列总和,这些子序列是连续的.去题目给的第二组 ...
- [转] MongoDB shell 操作 (查询)
最近有用到mongoDB,每次都去查看官方文档很是费劲,自己准备写点东西.但在博客园上看到另外的一篇博文不错,就转载过来,加上点儿自己的修饰 左边是mongodb查询语句,右边是sql语句.对照着用, ...
- C#: PerformanceCounter的使用
在实际编程中,有的时候需要密切注意CPU, Memory的变化.这个时候需要用到PerformanceCounter这个类,注意需要using System.Diagnostics; 这里只是在con ...
- ofbiz进击 。 ofbiz 退货流程(包含获取可退货项流程分析 以及 取消退货项的过程分析)
根据订单获取可退货项流程分析 退货的时候,调用 services_return.xml 中的获取可进行退货的退货项 getReturnableItems ,该服务调用了Java类 org.ofbi ...