English 中文(简体)
习俗 Ext.NetchlorGrid nodes?
原标题:Custom Ext.Net TreeGrid nodes?

I m gonna create an Ext.Net s TreeGrid with custom nodes.
e.g :
All of TreeGrid s nodes should have a textbox at the front of itself and users should write a number at it.
See the below image :

“Custom

此外,我还必须从背后的代码中获取每个节点文本箱值。

Could you please guide me, how I can create it with Ext.net and C# ?
Thanks.

最佳回答

我可以找到答案:

<ext:TreeGrid ID="KnowledgeFieldsTreeGridWithTextBox1" runat="server" Title="Fileds "
    Icon="Plugin" Height="300" AutoHeight="true" AutoExpandColumn="KnowledgeFiled">
    <TopBar>
        <ext:Toolbar ID="KnowledgeFieldsTreeGridWithTextBoxToolbar1" runat="server">
            <Items>
                <ext:ToolbarFill ID="KnowledgeFieldsTreeGridWithTextBoxToolbarFill1" runat="server" />
                <ext:ToolbarTextItem ID="KnowledgeFieldsTreeGridWithTextBoxTextItem1" runat="server"
                    Text=" Filter : " />
                <ext:TriggerField ID="KnowledgeFieldsTreeGridWithTextBox_TriggerField1" runat="server" EnableKeyEvents="true">
                    <Triggers>
                        <ext:FieldTrigger Icon="Clear" />
                    </Triggers>
                    <Listeners>
                        <KeyUp Fn="KnowledgeFieldsTreeGridWithTextBox_KeyUp" Buffer="250" />
                        <TriggerClick Fn="KnowledgeFieldsTreeGridWithTextBox_ClearFilter" />
                    </Listeners>
                </ext:TriggerField>
            </Items>
        </ext:Toolbar>
    </TopBar>
    <Columns>
        <ext:TreeGridColumn Header="Filed Name" DataIndex="KnowledgeFiledName" Width="100" Align="Center" />
        <ext:TreeGridColumn Header="Score" DataIndex="KnowledgeScore" Width="200" Align="Right">
            <XTemplate runat="server">
                <Html>
                    <tpl if="values.leaf">
                        <input type="text" style="width:30px; text-align:left;" maxlength="5" value="{KnowledgeFiledScore}"></input>
                    </tpl>
                </Html>
            </XTemplate>
        </ext:TreeGridColumn>
    </Columns>
    <Root>

    </Root>
    <Listeners>
        <BeforeClick Handler="return !Ext.fly(e.getTarget()).is( input[type=text] );" />
    </Listeners>
</ext:TreeGrid>
问题回答

不幸的是,通过目前发行的<代码>和>;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> 




相关问题
Is there a level limit in dojo treegrid?

I ve trying to get the treegrid using forestmodel to work the last several days. It seems to me that there is a limit to the number of level can be displayed using programmatically created treegrid. I ...

Extending and maintaining TreeGrid widget from CoqSoft

Anyone has experience extending the functionality of TreeGrid from CoqSoft using their APIs? I am looking for a good datagrid framework in Javascript to implement custom sorting, filtering, grouping ...

How to use JqGrid TreeGrid in MVC.NET 2?

theres not that much information over internet on how to use Trirand JqGrid TreeGrid option with MVC2. Anybody with an example?

OnMouseOver event in Coqsoft treegrid cell

Does anybody know if Treegrid supports OnMouseOver event? I need make an ajax call on mouse-over which might be compute intensive. Thanks

热门标签