Nov 29, 2012, 7:14 AM
[2.1] Razor view: DirectEvents custom attributes
Hi.
I am creating tree menu:
What is the difference of the function AttributesObject and CustomAttributes when pass object parameter?
I am creating tree menu:
@(Html.X().TreePanel()
.RootVisible(false)
.Root(Html.X().Node()
.Children(Html.X().Node()
.Text("MenuHeader")
.Expanded(true)
.Children(
Html.X().Node()
.Text("MenuItem1")
.Leaf(true)
.AttributesObject(new { url = "/Controller1/Index" }),
Html.X().Node()
.Text("MenuItem2")
.Leaf(true)
.AttributesObject(new { url = "/Controller2/Index" })
)
)
)
.DirectEvents(de => {
de.ItemClick.Url = "record.data.url";
//de.ItemClick.Url = JRawValue.From("record.data.url").ToString();
})
)
How to set DirectEvents Url value from clicked tree node custom attributes?What is the difference of the function AttributesObject and CustomAttributes when pass object parameter?