[CLOSED] [1.0] Render Panel to a non-ext object

  1. #1

    [CLOSED] [1.0] Render Panel to a non-ext object




    I have a panel:

    
    
    
    Panel PageContainer = new Panel();
    PageContainer.DirectEvents.Render.EventMask.ShowMask = true;
    PageContainer.DirectEvents.Render.EventMask.Msg = "Busy loading page configuration";
    PageContainer.DirectEvents.Render.Event += new ComponentDirectEvent.DirectEventHandler(Render_Page_Event);
    After the panel renders I loop through a collection to place panels in divs on my page:

    
    protected void Render_Page_Event(object sender, DirectEventArgs e)
    {
    
    
        foreach(var PlaceHolder in ContentPlaceHolders)
        {
           foreach (var Widget in PlaceHolder.Widgets) 
           {
                this.BuildWidgetPanel(Widget.PageWidgetId, Widget.WidgetFile, "Widget").Render("aec_" + PlaceHolder.id, RenderMode.AddTo);
            }
        }
    }
    
    
    private Panel BuildWidgetPanel(string PageWidgetId, string Title, string Html)
    {
    
    
        return this.Page.X().Panel()
        .ID("aep" + PageWidgetId)
        .Title(Title)
        .Html(Html);
    
    }
    I am getting an Exception that my (container)div is not defined when placing the panels in them, but I know they are there. (js exception : "aec_contentcntr is not defined")

    Should it be possible to place a Panel in any dom object (like a div)?


    UPDATE:

    I now use the AfterRender event and the error is not there anymore. That's a good thing.

    The result I got from my Event is:

    
    <CODE>{script:"Ext.net.ResourceMgr.destroyCmp(\"aep1\");new Ext.Panel({id:\"aep1\",autoShow:true,html:\"Widget</CODE><CODE> was created at: 16:03:40\",title:\"waverunner/ucAanbiedingen.ascx\"});aec_contentcntr.addAndDoLayout</CODE><CODE>(aep1);Ext.net.ResourceMgr.destroyCmp(\"aep2\");new Ext.Panel({id:\"aep2\",autoShow:true,html:\"Widget</CODE><CODE> was created at: 16:03:40\",title:\"nieuwsbrief/ucNieuwsbrief.ascx\"});aec_contentwest.addAndDoLayout</CODE><CODE>(aep2);Ext.net.ResourceMgr.destroyCmp(\"aep3\");new Ext.Panel({id:\"aep3\",autoShow:true,html:\"Widget</CODE><CODE> was created at: 16:03:40\",title:\"ucHtmlContent.ascx\"});aec_contenteast.addAndDoLayout(aep3);Ext.net</CODE><CODE>.ResourceMgr.destroyCmp(\"aep4\");new Ext.Panel({id:\"aep4\",autoShow:true,html:\"Widget was created</CODE><CODE> at: 16:03:40\",title:\"ucHeader.ascx\"});aec_header.addAndDoLayout(aep4);Ext.net.ResourceMgr.destroyCmp</CODE><CODE>(\"aep5\");new Ext.Panel({id:\"aep5\",autoShow:true,html:\"Widget was created at: 16:03:40\",title:\"ucHtmlContent</CODE><CODE>.ascx\"});aec_footer.addAndDoLayout(aep5);Ext.Msg.show({title:\"ID\",buttons:Ext.Msg.OK,msg:\"=1\"})</CODE><CODE>;"}</CODE>
    That seems to be good as well... only thing is that they won't get rendered on the page.

  2. #2

    RE: [CLOSED] [1.0] Render Panel to a non-ext object

    Hi,

    I think in your case you have to use RenderTo mode because if you use AddTo then container must be Ext.Net control only
  3. #3

    RE: [CLOSED] [1.0] Render Panel to a non-ext object

    Yes that was the problem.... too many lines of code for today I guess ;-)


Similar Threads

  1. [CLOSED] Panel html render problem
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 22, 2011, 1:49 PM
  2. [CLOSED] [1.0] Panel CustomConfig does not render during XRendering
    By r_honey in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 24, 2010, 1:41 AM
  3. [CLOSED] [1.0] render panel
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 06, 2010, 1:50 PM
  4. How to convert object in to Grid panel in javascripr
    By Satyanarayana murthy in forum 1.x Help
    Replies: 2
    Last Post: Dec 01, 2009, 12:13 AM
  5. [CLOSED] Render a panel with layout:'form'
    By jchau in forum 1.x Help
    Replies: 2
    Last Post: Sep 02, 2008, 11:48 AM

Posting Permissions