Feb 15, 2010, 6:44 AM
[CLOSED] [1.0] [MVC] FitLayout doesn't work on grid inside partial view.
I'm loading a partial view into a panel. However, I can't get the grid to fit the screen. I have the feeling it has something to do with the store being inside the same panel as the grid. But if I were to move it elsewhere, the grid can't find it anymore. This also happens if I set Layout="Fit" on the grid.
Controller action:
Controller action:
public Ext.Net.MVC.PartialViewResult Child(string containerId)
{
return new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.AddTo);
}
View:<ext:Viewport runat="server" AutoDataBind="true">
<Items>
<ext:BorderLayout runat="server">
<North>
<ext:Panel runat="server" Height="27" Border="false">
<Items>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Load Child">
<Listeners>
<Click Handler="#{ChildPanel}.load({ scripts: true, params: { containerId: #{ChildPanel}.id }, url: '/Home/Child' });" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</Items>
</ext:Panel>
</North>
<Center>
<ext:Panel ID="ChildPanel" runat="server" />
</Center>
</ext:BorderLayout>
</Items>
</ext:Viewport>
Partial view (Child.ascx):<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<ext:FitLayout runat="server">
<Items>
<ext:Panel ID="Panel1" runat="server">
<Content>
<ext:Store ID="Store1" runat="server" AutoLoad="true">
<Reader>
<ext:JsonReader Root="data" TotalProperty="totalCount">
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="Name" />
</Fields>
</ext:JsonReader>
</Reader>
<Proxy>
<ext:HttpProxy Url="/Home/TestData" />
</Proxy>
</ext:Store>
<ext:GridPanel runat="server" StoreID="Store1">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="Id" Header="Id" DataIndex="Id" Width="80" />
<ext:Column ColumnID="Name" Header="Name" DataIndex="Name" Width="200" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</Content>
</ext:Panel>
</Items>
</ext:FitLayout>