[CLOSED] Load window content from a controller method

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] Load window content from a controller method

    I would like to have a generic window opening on different component clicks but the content of this window should come from a controller method passing back a view to it. I would pass in some params to the controller method, the method constructs the view model and passes in to the view and then this view get's loaded as a content of the window.

    Why I want to do this?
    I am using your http://mvc2.ext.net/ solution as a reference. The content in the tabs created on the right has elements that should create a window the same way as you Source Code window. On top of all elements and not contained in the "tab space" like you have in your solution on Window examples http://mvc2.ext.net/#/Window_Basic/Hello_World/

    Please let me know if I need to clarify this question further.

    Thank you.
    Last edited by Daniil; Jan 30, 2015 at 1:44 PM. Reason: [CLOSED]
  2. #2
    Hello,

    Excuse me if I have misunderstood your question but is this what are you trying to do?

    https://examples2.ext.net/#/Window/B...ernal_Website/

    If not, posting an example of your code would be much appreciated in order to provide the right solution.
  3. #3
    No, not really.
    What I would like is to open a window like the one that open when you click on the Source Code button but the content of that window to be loaded from the controller method. And this controller method returns a view. It's all MVC we are talking about.

    Thank you
  4. #4
    Understood.

    Of course, there is the corresponding mvc window example (sorry for posting the webform link) but it is based on the Loader, too. On the other hand, in mvc, the url passed to the loader will result in a call to the corresponding controller... Should the controller method do something other than return the view?
    Last edited by Dimitris; Jan 09, 2015 at 5:37 PM.
  5. #5
    I think the problem is that I am working on the actual http://mvc2.ext.net/ solution. Downloaded.
    Even in the http://mvc2.ext.net/#/Window_Basic/L...ernal_Website/ sample you see that the window is opened inside the tab where the button that opened it resides.
    The only thing I would like to do is to have this window being "outside the tab".

    I have managed to open a window with JavaScript and then use this sample http://mvc2.ext.net/#/Dynamic_Partia...g/ASPX_Engine/ to load a view into a particular container. But it is still inside the tab.

    Do you have an idea how can I get outside the tab?

    Thank you
  6. #6
  7. #7
    These threads definitely describe the same problem I have. I'll look at the solutions provided.

    Thank you.
  8. #8
    It is a bit different in my situation. Perhaps you can suggest a solution...?

    I have a controller method returning

                    return this.PartialExtView(
                       viewName: "Edit",
                       model: viewModel
                    );
                    return this.Direct();
    And the view returned is:

                   <html>
                   <head>
                        <meta name="viewport" content="width=device-width" />
                        <title></title>
                    </head>
                    <body>
                         <div>
                               @( X.Window().ID("Edit")
                                                     .Title(Model.NAME)
                                                      .Icon(Icon.ApplicationViewDetail)
                                                      .Width(800)
                                                     .Height(550)
                                                     .Layout(LayoutType.Fit)
                                                     .Border(true)
    
                      etc...
    Can any of the suggested methods in those two posts be applied in my case? Maybe a different approach?

    Thank you.
  9. #9
    The main point here is the fact that the only solution is to open a Window from the parent page.

    Say, you have the parent page and its child page inside.

    If you open/create the Window inside the child page, it will be inside that child page. There is no way to get the Window belongs to the parent page unless you create that Window on the parent page.

    Can you have the Button (that creates a Window) inside the parent page, not inside the child page?
  10. #10
    I can't really create a window on the parent page because it is a double click on a grid row and a grid is in the child page.
    I tried a trick where I am calling a window create, and this window create code is in the parent page, so the dbl click triggers that code and loads a view inside that window. It is still the same problem.

    What I referred to in my previous question is the possibility of having something from examples you have mentioned
    renderTo : parent.Ext.getBody()
    or
    parent.renderWindow(windowConfig);
    in my scenario?

    Thank you.
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 8
    Last Post: May 12, 2013, 6:19 PM
  2. [CLOSED] [RAZOR] How to access ext.net controls from controller method
    By gets_gui in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 13, 2012, 8:12 AM
  3. Load Panel from MVC Controller
    By stu in forum 2.x Help
    Replies: 1
    Last Post: Jun 18, 2012, 11:26 PM
  4. Replies: 1
    Last Post: Apr 09, 2012, 1:07 PM
  5. Load menu panel from controller
    By wadhah in forum 1.x Help
    Replies: 1
    Last Post: Oct 28, 2011, 1:48 PM

Tags for this Thread

Posting Permissions