I have a masterpage with a viewport and content page with borderlayout. In the content page, I also have a store outside the borderlayout and a grid inside the borderlayout. When the page loads, JS error saying store not defined. This is because the store is created AFTER the borderlayout is created. If I move the store to my masterpage and place it outside the viewport, it's fine. However, the store is unique to the content page and should not be in masterpage. My only alternative right now is to add another contentplaceholder outside the viewport and put the store there. Just wondering if there's a better solution.

Please also tell me if all this Viewport-->BorderLayout-->Panel-->BorderLayout-->More Content is inefficient. I can't find another way to have my contentform resize correctly. This is a VERY simplified version of my production code. In production, the masterpage's borderlayout contains a North and South region so having a borderlayout is necessary but I am not sure how to get rid of the Panel-->BorderLayout in the contentform. I tried using a FitLayout but that didn't work.

MasterPage
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server">
    </ext:ScriptManager>

    <ext:ViewPort runat="server">
        <Content>
            <ext:BorderLayout runat="server">
                <Center MarginsSummary="5">                
                    <ext:Panel runat="server" Border="false">
                        <Content>
                            <asp:ContentPlaceHolder runat="server" ID="c">
                            </asp:ContentPlaceHolder>
                        </Content>
                    </ext:Panel>
                </Center>
            </ext:BorderLayout>
        </Content>
    </ext:ViewPort>
    </form>
</body>
</html>
ContentPage
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c" runat="server">
    <ext:Store ID="storeSuppliers" runat="server">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="CompanyName">
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:BorderLayout runat="server">
        <Center>
            <ext:GridPanel runat="server" ID="gridSuppliers" StoreID="storeSuppliers">
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column DataIndex="CompanyName" Header="Company Name">
                        </ext:Column>
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </Center>
    </ext:BorderLayout>
</asp:Content>