不幸的是,通过目前发行的<代码>和>;ext:TreeGrid>(Ext.NET)(v1.x)来落实这些特点,是极其困难的。 The <ext:TreeGrid>
is only not set up for such of makeing.
接下来的Ext.NET(v2),尽管此时此刻尚未释放。
这里有一个基本样本,帮助你开始提供<代码><input>领域。
<><>Example>
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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 runat="server">
<title>TreeGrid - Ext.NET Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var formatHours = function (v) {
if (v || v === 0) {
return "Number : <input class="x-form-text x-form-field" type="text" value="" + v + "" />";
}
return "";
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:TreeGrid
ID="TreeGrid1"
runat="server"
Title="Projects"
Width="500"
Height="300"
NoLeafIcon="true"
EnableDD="true">
<Columns>
<ext:TreeGridColumn Header="Task" Width="230" DataIndex="task" />
<ext:TreeGridColumn Header="Score" Width="200" DataIndex="duration" Align="Center" SortType="AsFloat">
<XTemplate runat="server">
<Html>
{duration:this.formatHours}
</Html>
<Functions>
<ext:JFunction Name="formatHours" Fn="formatHours" />
</Functions>
</XTemplate>
</ext:TreeGridColumn>
</Columns>
<Root>
<ext:TreeNode Text="Tasks">
<Nodes>
<ext:TreeNode Icon="Folder" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Project: Shopping" Mode="Value" />
</CustomAttributes>
<Nodes>
<ext:TreeNode Icon="Folder" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Remodeling" Mode="Value" />
</CustomAttributes>
<Nodes>
<ext:TreeNode Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Paint bedroom" Mode="Value" />
</CustomAttributes>
<Nodes>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Ceiling" Mode="Value" />
<ext:ConfigItem Name="duration" Value="1.25" />
</CustomAttributes>
</ext:TreeNode>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Walls" Mode="Value" />
<ext:ConfigItem Name="duration" Value="1.5" />
</CustomAttributes>
</ext:TreeNode>
</Nodes>
</ext:TreeNode>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Decorate living room" Mode="Value" />
<ext:ConfigItem Name="duration" Value="12" />
</CustomAttributes>
</ext:TreeNode>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Fix lights" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0" />
</CustomAttributes>
</ext:TreeNode>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Reattach screen door" Mode="Value" />
<ext:ConfigItem Name="duration" Value="142" />
</CustomAttributes>
</ext:TreeNode>
<ext:TreeNode Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Retile kitchen" Mode="Value" />
<ext:ConfigItem Name="duration" Value="96" />
</CustomAttributes>
</ext:TreeNode>
</Nodes>
</ext:TreeNode>
</Nodes>
</ext:TreeNode>
</Nodes>
</ext:TreeNode>
</Root>
</ext:TreeGrid>
</form>
</body>
</html>