PDA

View Full Version : [CLOSED] Showing Ext Windows



UnifyEducation
Sep 20, 2012, 12:26 PM
Hi,

I want to load Ext windows from javascript.
It displays quickly before, but after update from svn, I got many error like:
Uncaught TypeError: Object [object Object] has no method 'addCls'
Uncaught TypeError: Object [object Object] has no method 'findParent'
...



/Test/Test1.cshtml:



@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Test1</title>
<script>
showWindows = function () {
var win = new Ext.Window({
width: 210,
height: 185,
modal: 'true',
autoLoad: {
url: '/Test/Test2',
scripts: true
}
});
win.show();
}

</script>
</head>
<body>
<div>
@(Html.X().ResourceManager())
@(Html.X().Button().Text("Click Me").Listeners(l=>l.Click.Handler="showWindows();"))
</div>
</body>
</html>



/Test/Test2.cshtml


@{
Layout = null;
}

@Html.X().ResourceManager()
@(Html.X().FormPanel().ID("myPanel").MinWidth(200)
.Items(i =>
{

i.Add(Html.X().Button().Text("Test1")
.TextAlign(ButtonTextAlign.Center)
.Width(150).Margin(5));
i.Add(Html.X().Button().Text("Test1")
.TextAlign(ButtonTextAlign.Center)
.Width(150).Margin(5));
}))

Vladimir
Sep 20, 2012, 5:34 PM
What is controller action code?

UnifyEducation
Sep 20, 2012, 5:44 PM
What is controller action code?

Hi, Here it is:



public ActionResult Test1()
{
return View();
}
public ActionResult Test2()
{
return View();
}

Daniil
Sep 20, 2012, 6:48 PM
Hi,

According the controller actions, you should set "frame" renderer.

autoLoad: {
url: "/Test/Test2",
renderer : "frame"
}