<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Complex Layout - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../themes/icon.css">
<script type="text/javascript" src="../jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script>
$(function(){
$('#tt2').datagrid({
title:'My Title',
iconCls:'icon-save',
width:600,
height:350,
nowrap: false,
striped: true,
fit: true,
url:'datagrid_data.json',
sortName: 'code',
sortOrder: 'desc',
idField:'code',
frozenColumns:[[
{field:'ck',checkbox:true},
{title:'code',field:'code',width:80,sortable:true}
]],
columns:[[
{title:'Base Information',colspan:3},
{field:'opt',title:'Operation',width:100,align:'center', rowspan:2}
],[
{field:'name',title:'Name',width:120},
{field:'addr',title:'Address',width:120,rowspan:2,sortable:true},
{field:'col4',title:'Col41',width:150,rowspan:2}
]],
onClickCell:function(index,field,value){
//alert(234);
if(field == "col4")
{
//$(".datagrid-wrap panel-body").height(100);
//$(".datagrid-view").height(100);
//$(".datagrid-body").height(100);
var t_index=parseInt(index)+1;
$("td[field=col4]").css("color","#000000");
$("td[field=col4]").eq(t_index).css("color","#00ffff");
}
},
pagination:true,
rownumbers:true
});
$('#tt3').datagrid({
url: 'datagrid_data2.json',
title: 'DataGrid',
width: 700,
height: 300,
fitColumns: true,
nowrap:false,
columns:[[
{field:'itemid',title:'Item ID',width:80},
{field:'productid',title:'Product ID',width:120},
{field:'listprice',title:'List Price',width:80,align:'right',
styler:function(value,row,index){
if (value < 20){
return 'background-color:#ffee00;color:red;';
}
}
},
{field:'unitcost',title:'Unit Cost',width:80,align:'right'},
{field:'attr1',title:'Attribute',width:250},
{field:'status',title:'Status',width:60,align:'center'}
]],
onClickCell:function(index,field,value){
//alert(234);
if(field == "status")
{
//alert(111);
//$(".panel datagrid").height(100);
$(".datagrid-wrap panel-body").height(100);
$(".datagrid-view").height(100);
//$(".datagrid-view2").height(100);
//$(".datagrid-view1").height(100);
$(".datagrid-body").height(100);
var t_index=parseInt(index)+1;
$("td[field=status]").css("color","#000000");
$("td[field=status]").eq(t_index).css("color","#00ffff");
}
},
rowStyler:function(index,row,css){
if (row.listprice>80){
return 'background-color:#6293BB;color:#fff;font-weight:bold;';
}
}
});
});
</script>
</head>
<body class="easyui-layout">
<div region="north" title="North Title" split="true" style="height:100px;padding:10px;">
<p>The north content.</p>
</div>
<div region="south" title="South Title" split="true" style="height:100px;padding:10px;background:#efefef;">
<div class="easyui-layout" fit="true" style="background:#ccc;">
<div region="center">sub center</div>
<div region="east" split="true" style="width:200px;">sub center</div>
</div>
</div>
<div region="east" iconCls="icon-reload" title="Tree Menu" split="true" style="width:180px;">
<ul class="easyui-tree" url="tree_data.json"></ul>
</div>
<div region="west" split="true" title="West Menu" style="width:280px;padding1:1px;overflow:hidden;">
<div class="easyui-accordion" fit="true" border="false">
<div title="Title1" style="padding:10px;overflow:auto;">
<p>content1</p>
<p>content1</p>
<p>content1</p>
<p>content1</p>
<p>content1</p>
<p>content1</p>
<p>content1</p>
<p>content12</p>
</div>
<div title="Title2" selected="true" style="padding:10px;">
content2
</div>
<div title="Title3" style="padding:10px">
content3
</div>
</div>
</div>
<div region="center" title="Main Title" style="overflow:hidden;">
<div class="easyui-tabs" fit="true" border="false">
<div title="Tab1" style="padding:20px;overflow:hidden;">
<div style="margin-top:20px;">
<h3>jQuery EasyUI framework help you build your web page easily.</h3>
<li>easyui is a collection of user-interface plugin based on jQuery.</li>
<li>using easyui you don't write many javascript code, instead you defines user-interface by writing some HTML markup.</li>
<li>easyui is very easy but powerful.</li>
</div>
</div>
<div title="Tab2" closable="true" style="padding:20px;">
<table id="tt2"></table>
</div>
<div title="Tab3" iconCls="icon-reload" closable="true" style="overflow:hidden;padding:5px;">
<table id="tt3"></table>
</div>
</div>
</div>
</body>
</html>