Jan 07, 2014, 4:52 AM
[CLOSED] Tree panel node icon change
Hi,
I am using Tree panel with 'AttributesObject'. And set property value of tree panel to 'Icon(Icon.None)' to hide default icon(Folder) displayed for each node.
But it is not working for me, could you please suggest what needs to be added to hide default icons for each node of Tree panel.
Here is my code looks like -
View
Thanks
I am using Tree panel with 'AttributesObject'. And set property value of tree panel to 'Icon(Icon.None)' to hide default icon(Folder) displayed for each node.
But it is not working for me, could you please suggest what needs to be added to hide default icons for each node of Tree panel.
Here is my code looks like -
View
@model NodeCollection
@(Html.X().ResourceManager())
@(Html.X().Container().ID("EntityDisplayTree").Items(
Html.X().TreePanel().ID("EntityDisplayTreeNotes").Header(false)
.RootVisible(false)
.Icon(Icon.None)
.UseArrows(true)
.Fields(
Html.X().ModelField().Name("entityText"),
Html.X().ModelField().Name("iconHtml").Type(ModelFieldType.String)
)
.ColumnModel(
Html.X().Column().Align(Alignment.Right).DataIndex("iconHtml").Renderer("displayIcons").Width(75),
Html.X().TreeColumn().DataIndex("entityText").Width(280)
)
.Root(Html.X().Node().NodeID("0").Text("All Notes").Children(Model))
)
)
<script type="text/javascript">
var displayIcons = function (value, meta, record, index) {
return Ext.String.format(record.data.iconHtml);
};
</script>
Controller codepublic ActionResult TreeProblem()
{
var nodeCollection = new NodeCollection();
Node rootStartNode = new Node();
rootStartNode.AttributesObject = new
{
entityText = "RootStartNode",
iconHtml = "icon",
};
rootStartNode.Expanded = true;
nodeCollection.Add(rootStartNode);
var node1 = new Node();
node1.AttributesObject = new
{
entityText = "Node1",
iconHtml = "icon1",
};
var node1Child = new Node();
node1Child.Leaf = true;
node1Child.AttributesObject = new
{
entityText = "Node1Child",
iconHtml = "icon1Child",
};
node1.Children.Add(node1Child);
rootStartNode.Children.Add(node1);
return View(nodeCollection);
}
Also please see the image for output and highlighted icons to be removed(hide).Thanks
Last edited by Daniil; Jan 14, 2014 at 7:38 AM.
Reason: [CLOSED]