Nov 24, 2012, 8:31 AM
[CLOSED] Treegrid nodes
Hi,
I've some problems using the treegrid. If the grid load data using the model the nodes description are empty.
This is the controller action I use to render the view :
Regards,
Alberto
I've some problems using the treegrid. If the grid load data using the model the nodes description are empty.
This is the controller action I use to render the view :
public ActionResult Index()
{
NodeCollection nodes = new Ext.Net.NodeCollection();
nodes.AddRange( new [] { new Node()
{
Text = "1",
NodeID = "1",
Leaf = true,
AttributesObject = new
{
Code = "1Code",
Description = "1Description",
CreationDate = "1CreationDate",
LastUpdateDate = "1LastUpdateDate"
}
},
new Node()
{
Text = "2",
NodeID = "2",
Leaf = true, //c.Children.Any(),
AttributesObject = new
{
Code = "2Code",
Description = "2Description",
CreationDate = "2CreationDate",
LastUpdateDate = "2LastUpdateDate"
}
}
});
return View(nodes);
}
This is the view :@model Ext.Net.NodeCollection
@(
Html.X().Viewport()
.Layout(LayoutType.Border)
.Split(true)
.Items(vpItems =>
{
vpItems.Add(
Html.X().TreePanel()
.Height(300)
.Split(true)
.AnimCollapse(true)
.Collapsible(true)
.Region(Region.Center)
.UseArrows(true)
.RootVisible(false)
.Fields(
Html.X().ModelField().Name("Description")
)
.ColumnModel(
Html.X().TreeColumn().DataIndex("Description").Text("description")
)
.Root(Html.X().Node().NodeID("0").Text("description").Children(Model))
);
})
)
What should I change to make it work ?Regards,
Alberto
Last edited by Daniil; Nov 28, 2012 at 3:03 PM.
Reason: [CLOSED]