Jun 30, 2013, 5:00 PM
MVC: TreePanel + FormPanelFor - How to load Record depending on Item clicked in TreePanel
Hi,
I have some difficulties to understand some basic concepts how I can load C# model instances asynchronous into Panels.
Lets assume I have a TreePanel, like in some examples which gets a collection of Nodes through a ActionMethod + a FormPanelFor for the page model:
If someone can recommend me some good book or other material about Ext.NET MVC I would be also very happy. The examples on the page are nice but I do not really understand the concepts of the communication between the clientside JavaScript and the C# backend. I also tried to Ext.NET Web Application Development but I feel like it's not so helpful with MVC since it's mostly about WebForms.
I would be very thankful for some help.
I have some difficulties to understand some basic concepts how I can load C# model instances asynchronous into Panels.
Lets assume I have a TreePanel, like in some examples which gets a collection of Nodes through a ActionMethod + a FormPanelFor for the page model:
@model Ext.Models.Company
@(Html.X().TreePanel()
.Store(Html.X().TreeStore()
.Proxy(Html.X().AjaxProxy().Url(Url.Action("GetChildren")))
)
.Root(Html.X().Node().NodeID("0").Text("Root"))
.Listeners(l => {
l.ItemClick.Handler = "alert(record.data.id);";
})
)
@(Html.X().FormPanelFor(m => m))
The ASP MVC Controller has the following methods:public StoreResult GetChildren(string node);
public StoreResult GetCompanyById(string id);
How can I say now in the l.ItemClick.Handler that I want to call the GetCompanyById method and load it into the FormPanelFor.If someone can recommend me some good book or other material about Ext.NET MVC I would be also very happy. The examples on the page are nice but I do not really understand the concepts of the communication between the clientside JavaScript and the C# backend. I also tried to Ext.NET Web Application Development but I feel like it's not so helpful with MVC since it's mostly about WebForms.
I would be very thankful for some help.