Can not apply layout using RenderExtPartial

  1. #1

    Can not apply layout using RenderExtPartial

    I write something like this:
        <ext:Viewport runat="server" Layout="Fit" AutoScroll="true">
            <Items>
                <ext:Panel id='ContentPanel' runat="server" Header="false" AutoScroll="true">
                    <Content>
                        <%= Html.RenderExtPartial("MyPartial") %>
                    </Content>
                </ext:Panel>
            </Items>
        <ext:ViewPort>
    MyPartial
    <ext:FormPanel>
    ...
    </ext:FormPanel>
    In this case, I want that the FormPanel rendered by Ext can fit the Viewport, but when I set the ContentPanel's Layout='FitLayout', 'MyPartial' will be rendered at the bottom of the 'ContentPanel', and if I wrap the FormPanel with <ext:FitLayout>, it will be rendered at the top of 'ContentPanel' and only have a little height(about 10px?). If I put the wrapped FormPanel in <Content> directly, it rendered OK!
    So, how can I set the layout when using RenderExtPartial in <Content>? Or there are other solutions?
    Thanks a lot.
  2. #2
    Hi,

    'Html.RenderExtPartial' requires to define container id and render mode (as arguments) because RenderExtPartial just return a string and there is no control hierarchy
    Why don't you want to use WebForm syntax?
    <ext:Panel id='ContentPanel' runat="server" Header="false" AutoScroll="true">
                <Content>
                    <uc:MyPartial runat="server" />
                </Content>
            </ext:Panel>
  3. #3
    Quote Originally Posted by Vladimir View Post
    Hi,

    'Html.RenderExtPartial' requires to define container id and render mode (as arguments) because RenderExtPartial just return a string and there is no control hierarchy
    Why don't you want to use WebForm syntax?
    <ext:Panel id='ContentPanel' runat="server" Header="false" AutoScroll="true">
                <Content>
                    <uc:MyPartial runat="server" />
                </Content>
            </ext:Panel>
    Because I need to render a view dynamic at runtime in Asp.Net Mvc. I'v checked the code of 'RenderExtPartial' today, and I found that it only 'RenderTo' a new Panel(not also 'AddTo' to an container), so I modified the source and everything seems OK now.

Similar Threads

  1. [CLOSED] Problems with RenderExtPartial
    By T3rryChan in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 17, 2012, 5:36 PM
  2. RenderExtPartial Issue
    By zhangjiagege in forum 1.x Help
    Replies: 3
    Last Post: Jan 21, 2012, 2:02 PM
  3. [CLOSED] Need Guidance with RenderExtPartial
    By paulc in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Mar 15, 2011, 8:13 PM
  4. [CLOSED] [1.0] How to apply CSS class for Cells in Table Layout.
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 20, 2010, 5:35 PM
  5. [CLOSED] [1.0] EditableGrid Apply to selection apply to all
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 24, 2010, 5:49 PM

Posting Permissions