PDA

View Full Version : Show window defined in another file within a Javascript function



ChristianSA
14 Dec 2013, 4:13 PM
I am using Ext.net.mvc and Razor.

I can do it by calling a DirectEvent and returning a PartialView. However, I would prefer to do it from Javascript.

This is a simplified version of what I would like to do:

index.cshtml:


<script>
function showWindow() {

/* What goes here to show the window defined in mywindow.cshtml? */
}
</script>

@(X.ResourceManager())
@(X.Button()
.Text("Show")
.Listeners(ls =>
{
ls.Click.Handler = "App.wnd.show()";
})
)



mywindow.cshtml

@(X.Window()
.ID("wnd")
.Title("Test")
.Height(300)
.Width(400)
)



I have tried a range of methods without any luck so far. So I hope somebody can help.

Kevin Jackson
16 Dec 2013, 2:32 PM
I checked with one of our senior support people and his response was

If the page has the javascript loaded, you can execute whatever js function to show the window.
The app shouldn't be a bunch of different pages but a single page loading a couple js/css files (or hundreds in dev).
So you really aren't using the view part of a server side MVC framework