easyui 动态增加空间后 样式的渲染

来源:互联网 发布:波特兰州立大学知乎 编辑:程序博客网 时间:2024/04/27 21:26

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pages</title>
<link rel="stylesheet" type="text/css" href="${rc.getContextPath()}/js/jqueryeasyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${rc.getContextPath()}/js/jqueryeasyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${rc.getContextPath()}/css/statistics/style.css">
<script type="text/javascript" src="${rc.getContextPath()}/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${rc.getContextPath()}/js/jqueryeasyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${rc.getContextPath()}/js/jqueryeasyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<input type="hidden" value="<#if sType??>${sType}</#if>" name="sType" id="sType"/>
<input type="hidden" value="<#if sYear??>${sYear?c}</#if>" name="sYear" id="sYear"/>
<input type="hidden" value="<#if sMonth??>${sMonth?c}</#if>" name="sMonth" id="sMonth"/>

<table cellpadding="0" fit="true" cellspacing="0" width="99%" border="0" class="data" id="list">
</table>
</body>
<script text="text/javascript">
var stype = $('#sType').val();
var syear = $('#sYear').val();
var smonth = $('#sMonth').val();


$(function(){
var str = '';
$.ajax({
url: '/admin/statistics/listData.json?t=' + new Date().getTime(),
data: {sType: stype, sYear: syear, sMonth: smonth},
success: function(data){
str += '<tr><th width="300px" class="tableHead">指标</th><th width="200px">现价</th><th width="200px">不变价</th><th>比上年同期增长</th></tr>';
for(var i = 0; i< data.length; i++){
if(data[i].s1 == null) data[i].s1 = 0;
if(data[i].s2 == null) data[i].s2 = 0;
if(data[i].s3 == null) data[i].s3 = 0;
str += '<tr><td style="background:#E8E8E8">'+ data[i].title +'</td>';
str += '<td><input type="text" name="s1" class="easyui-numberbox" data-options="required:true" value='+data[i].s1+' /></td>';
str += '<td><input type="text" name="s2" class="easyui-numberbox" data-options="required:true" value='+data[i].s2+' /></td>';
str += '<td><input type="text" name="s3" class="easyui-numberbox" data-options="required:true" value='+data[i].s3+' />';
str += '<input type="hidden" name="treeId" value="'+data[i].treeId+'" /><input type="hidden" name="pId" value="'+data[i].pId+'" /></td>';
}
str += '</tr>';
var targetObj = $('#list').html(str);
$.parser.parse(targetObj);

}
});
});
</script>


</html>

0 0