Dec 19, 2014, 11:41 AM
[OPEN] [#570] Partial view with component loader
Hi,
I am upgrading a project from 2.5 and I have an issue with loading a partial view in a window using a directevent. The same code works in 2.5 but not in 3.0. In 3.0 the partial view is loaded in the background but it is not rendered, the window stays blank.
Thanks in advance!
I created a simplified example:
controller
I am upgrading a project from 2.5 and I have an issue with loading a partial view in a window using a directevent. The same code works in 2.5 but not in 3.0. In 3.0 the partial view is loaded in the background but it is not rendered, the window stays blank.
Thanks in advance!
I created a simplified example:
controller
public ActionResult Index()
{
return View();
}
[DirectMethod]
public ActionResult ButtonShowWindow()
{
//loader
ComponentLoader WinLoader = new ComponentLoader
{
Url = Url.Action("window", "Test"),
Scripts = true
};
//add parameter
WinLoader.Params.Add(new Parameter("containerId", "testWindow"));
//create window
Window win = new Window
{
ID = "testWindow",
Title = "test",
Height = 450,
Width = 550,
Loader = WinLoader,
Layout = "FitLayout"
};
win.Render(RenderMode.Auto);
return this.Direct();
}
public ActionResult window(string containerId)
{
return new Ext.Net.MVC.PartialViewResult
{
ContainerId = containerId,
RenderMode = RenderMode.AddTo
};
}
Index view@(Html.X().ResourceManager())
@(Html.X().Button()
.Text("Show window")
.DirectEvents(de =>
{
de.Click.Url = Url.Action("ButtonShowWindow");
})
)
Window view@(Html.X().Panel()
.Width(200)
.Height(200)
.Icon(Icon.Clock)
.Title("Server Time")
.Padding(10)
.Html(DateTime.Now.ToLongTimeString())
)
Last edited by Daniil; Dec 21, 2014 at 1:19 PM.
Reason: [OPEN] [#570]