Nov 15, 2013, 5:03 PM
[CLOSED] Hide Tree Panel Node in Razor
Hello
I have a simple tree panel and wish to use server processing to decide if certain nodes should be presented to the user. Some nodes always will, some will not.
Here is my example
Thank you for your help.
I have a simple tree panel and wish to use server processing to decide if certain nodes should be presented to the user. Some nodes always will, some will not.
Here is my example
@{
Layout = "_BaseLayout.cshtml";
var X = Html.X();
}
@section example
{
@(
Html.X().Viewport()
.Items(
(
X.TreePanel()
.ID("treePanel")
.Width(300)
.RootVisible(false)
.Root(
X.Node()
.Text("Configuration")
.Expanded(true)
.Expandable(false)
.Children(
X.Node()
.Text("Areas")
.Expanded(true)
.Expandable(true)
.Children(
X.Node().Text("Area A").Leaf(true),
X.Node().Text("Area B").Leaf(true),
X.Node().Text("Area C").Leaf(true)
)
)
)
)
)
)
}
However, I cannot find a way to do something likeX.Node().Text("Area A").Leaf(true).Visible(Model.Permissions.AreaA)
Maybe their is something I missing about how to use the Razor Syntax within the Children collection.Thank you for your help.
Last edited by Baidaly; Nov 16, 2013 at 12:25 AM.
Reason: [CLOSED]