jquery easyui treegrid
treegrid可以帮助我们事件树状下钻的报表格式,如图:
代码主要结构:
$('#tt').treegrid({
url:'treegrid_data.json',
treeField:'name',
columns:[[
{title:'Task Name',field:'name',width:180},
{field:'persons',title:'Persons',width:60,align:'right'},
{field:'begin',title:'Begin Date',width:80},
{field:'end',title:'End Date',width:80} ,
.........
]],
onClickRow:function(row){
alert(row.persons);
} ,
onClickCell:function(field,row){
alert(field);
}
});
注意:需要导入包 jquery.easyui.min.js和相关的css
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">