Load PartialViews on Panel

  1. #1

    Load PartialViews on Panel

    Hi,

    I want to load several PartialViews on a Panel. That is, I have a selection list and each time an element is selected I want to load only the PartialView associated with this element.

    If I use a DirectEvent, I can load a Partial view but Controls are added to the existed ones. Besides, with a DirectEvent I don't know how to change the url to render the PartialView dynamically.

    If I use a Listener instead and load the PartialView url on the Panel, I only can view the string corresponding to the control javascript declaration.

    Does anyone knows how can I perform this?

    Thanks in advance,

    Dominik.
  2. #2
    Hi,

    In my MVC application I could load several PartialViews on a Panel using a DirectEvent or following the sample code explained at this other thread:

    [CLOSED] Universal controller call in MVC

    I pass a parameter to my Controller in relation with the ViewName to be loaded in the PartialView.

    My problem is that I only want one PartialView at the same time. So if all my user controls have a panel with the same ID, only one controls is loaded, otherwise PartialViews are added to the container.

    But having all the user controls the same main panel ID, when I load a new PartialView I have this error at Ext.layout.ContainerLayout.isValidParent method:

    Error: 'getPositionEl().dom.parentNode' is null or not an object

    How can I load only one PartialView in my main container?

    Thanks,

    Dominik.
  3. #3
    Please,

    Any help about how to load only one PartialView in any Controller action call?

    Thanks,

    Dominik.
  4. #4
    Quote Originally Posted by Dominik View Post
    Hi,

    I want to load several PartialViews on a Panel. That is, I have a selection list and each time an element is selected I want to load only the PartialView associated with this element.

    If I use a DirectEvent, I can load a Partial view but Controls are added to the existed ones. Besides, with a DirectEvent I don't know how to change the url to render the PartialView dynamically.

    If I use a Listener instead and load the PartialView url on the Panel, I only can view the string corresponding to the control javascript declaration.

    Does anyone knows how can I perform this?

    Thanks in advance,

    Dominik.
    Please see how to change DirectEvent's url on the fly
    http://forums.ext.net/showthread.php?12487
  5. #5
    Hi Daniil,

    I could change url with a DirectEvent as I explaiden in my second post.

    My problem now is how to load only one PartialView at a time in my Panel container. Basically I want to change one PartialView by another one, but I don't know how to render in this way.

    If I use "RenderMode.AddTo" controls are added to the Panel, but I don't find any other mode to view only this PartialView. I could do that naming all my PartialView main Panels with the same name, but then I have "Error: 'getPositionEl().dom.parentNode' is null or not an object" error when loading a new PartialView.

    I only can imagine to clear all Panel container items before load a new PartialView...

    It it possible to perform this in some oher way?

    Thanks again,

    Dominik.
  6. #6
    You could clear the container's content in the Before handler of DirectEvent, please see
    http://forums.ext.net/showthread.php?12528

Similar Threads

  1. Panel load
    By Pfuentes in forum 1.x Help
    Replies: 0
    Last Post: Oct 05, 2011, 7:34 PM
  2. how to load data to grid panel in page load
    By andylaiyongsing in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 10:27 AM
  3. [CLOSED] [1.0] MVC PartialViews and Icons
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 19, 2010, 3:35 PM
  4. [CLOSED] [1.0] MVC PartialViews and styles?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Feb 14, 2010, 4:12 PM
  5. Load Panel into Tab
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: May 14, 2009, 12:51 PM

Posting Permissions