К сожалению, реализация этих функций в текущей версии <ext:TreeGrid>
в Ext.NET (v1.x) досадно трудна.<ext:TreeGrid>
просто не настроен для этого типа рендеринга.
В следующем выпуске Ext.NET (v2) есть помощь, хотя на данный момент она еще не выпущена.
Вот базовый пример, который поможет вам начать рендеринг полей <input>
.
Пример
<%@ 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>