62,267
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
Ext.onReady(function () {
var tree = new Ext.tree.ColumnTree({
el: 'tree-ct',
width: 750,
autoHeight: true,
rootVisible: false,
autoScroll: true,
title: 'Redmine',
columns: [{
header: '项目',
width: 350,
dataIndex: 'task'
}, {
header: '小项目',
width: 100,
dataIndex: 'duration'
}, {
header: '问题',
width: 100,
dataIndex: 'user'
},
{
header: '小问题',
width: 100,
dataindex: '_Problem'
}],
loader: new Ext.tree.TreeLoader({
dataUrl: 'Service_comlumnTree.aspx?cmd=tree',
listeners: {
load: function () {
this;
}
},
uiProviders: {
'col': Ext.tree.ColumnNodeUI
}
}),
root: new Ext.tree.AsyncTreeNode({
text: 'Tasks'
})
});
tree.render();
});
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Service_comlumnTree : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string cmd = Request.QueryString["cmd"];
switch (cmd)
{
case "tree":
GetTreeJson();
break;
default:
break;
}
}
public void GetTreeJson()
{
string json = "[{";
json += "task:'ColumnTree Example',";
json += "duration:'3 hours',";
json += "user:'',";
json += "uiProvider:'col',";
json += "cls:'master-task',";
json += "iconCls:'task-folder',";
json += "'children':[{";
json += "task:'Abstract rendering in TreeNodeUI',";
json += "duration:'15 min',";
json += "user:'Jack Slocum',";
json += "uiProvider:'col',";
json += "cls:'master-task',";
json += "iconCls:'task-folder',";
json += "children:[{";
json += "task:'Abstract rendering in TreeNodeUI',";
json += "duration:'15 min',";
json += "user:'Jack Slocum',";
json += "uiProvider:'col',";
json += "cls:'master-task',";
json += "iconCls:'task-folder'";
json += "},{";
json += "children:[{";
json += "task:'Create TreeNodeUI with column knowledge',";
json += "duration:'45 min',";
json += "user:'Jack Slocum',";
json += "uiProvider:'col',";
json += "leaf:true,";
json += "iconCls:'task'";
json += "},{";
json += "task:'Create TreePanel to render and lock headers',";
json += "duration:'30 min',";
json += "user:'Jack Slocum',";
json += "uiProvider:'col',";
json += "leaf:true,";
json += "iconCls:'task'";
json += "},{";
json += "task:'Add CSS to make it look fly',";
json += "duration:'30 min',";
json += "user:'Jack Slocum',";
json += "uiProvider:'col',";
json += "leaf:true,";
json += "iconCls:'task'";
json += "},{";
json += "}]";
json += "}]";
json += "}]";
json += "}]";
Response.Write(json);
Response.End();
}
}