Jul 17, 2013, 2:27 PM
[CLOSED] TreePanel(grid) CustomAttributes doesn't work (code behind)
Hi
i want add nodes to treegrid. but i got some errors
when i use this format , i got the js error : scenarioname is undefined
i want add nodes to treegrid. but i got some errors
when i use this format , i got the js error : scenarioname is undefined
root.CustomAttributes.Add( new ConfigItem("step", selectedScenario.Name.ToString() , Ext.Net.ParameterMode.Raw));
when i use this format it works but it looks like a bug.root.CustomAttributes.Add( new ConfigItem("step","'" + selectedScenario.Name.ToString() + "'" , Ext.Net.ParameterMode.Raw));
markup treepanel<ext:TreePanel ID="stepTree" runat="server" RootVisible="true" FolderSort="true" SingleExpand="true" UseArrows="true" Title="title">
<Fields>
<ext:ModelField Name="step"/>
<ext:ModelField Name="target"/>
<ext:ModelField Name="process"/>
</Fields>
<ColumnModel>
<Columns>
<ext:TreeColumn runat="server" Sortable="true" Text="Adımlar" Flex="2" DataIndex="step"></ext:TreeColumn>
<ext:Column runat="server" Sortable="true" Text="Hedefler" Flex="1" DataIndex="target"></ext:Column>
<ext:Column runat="server" Sortable="true" Text="İşlem" Flex="1" DataIndex="process"></ext:Column>
<ext:ActionColumn runat="server" Text="Edit" Width="40" Align="Center" >
<Items>
<ext:ActionItem Tooltip="Edit" Icon="PageWhiteEdit"></ext:ActionItem>
</Items>
</ext:ActionColumn>
</Columns>
</ColumnModel>
</ext:TreePanel>
cs (working version)Ext.Net.Node root = new Ext.Net.Node
{
NodeID = selectedScenario.ID + "root",
Expanded = true,
Icon = Ext.Net.Icon.Pencil
};
root.CustomAttributes.Add( new ConfigItem("step","'" + selectedScenario.Name.ToString() + "'" , Ext.Net.ParameterMode.Raw));
Ext.Net.Node child = new Ext.Net.Node
{
NodeID = "1",
Expanded = true,
Icon = Ext.Net.Icon.Pencil,
Leaf = true
};
child.CustomAttributes.Add(new ConfigItem("step", "'" + selectedScenario.Name.ToString() + "'", Ext.Net.ParameterMode.Raw));
root.Children.Add(child);
stepTree.Root.Add(root);
stepTree.Render();
Thanks
Last edited by Daniil; Jul 17, 2013 at 4:40 PM.
Reason: [CLOSED]