View Full Version : Store not found with ViewPort in MasterPage

Oct 15, 2008, 8:15 PM
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.


<%@ 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">
<asp:ContentPlaceHolder ID="head" runat="server">
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server">

<ext:ViewPort runat="server">
<ext:BorderLayout runat="server">
<Center MarginsSummary="5">
<ext:Panel runat="server" Border="false">
<asp:ContentPlaceHolder runat="server" ID="c">


<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<asp:Content ID="Content2" ContentPlaceHolderID="c" runat="server">
<ext:Store ID="storeSuppliers" runat="server">
<ext:RecordField Name="CompanyName">
<ext:BorderLayout runat="server">
<ext:GridPanel runat="server" ID="gridSuppliers" StoreID="storeSuppliers">
<ColumnModel runat="server">
<ext:Column DataIndex="CompanyName" Header="Company Name">

Oct 16, 2008, 6:28 AM

Any Layout must be sole control in Content area. The Store must defined above any controls which used this Store. I think your solution with additional ContentPlaceholder is good

Oct 17, 2008, 6:58 AM
Please also tell me if all this Viewport-->BorderLayout-->Panel-->BorderLayout-->More Content is inefficient.

That layout configuration is not a problem and will be rendered very efficiently. I've built Panel-->Layout samples with 10+ levels deep and did not notice any performance issues.

I'm also running some tests with your code sample and I think we should be able to tweak the Layout logic to make this scenario work.

Nov 03, 2008, 2:35 PM
I just ran into a similar issue with a parent page/usercontrol with the following setup:

Page--> Viewport --> BorderLayout --> Center --> Panel --> UserControl --> Store, GridPanel

Unfortunately, I can't apply the workaround with MasterPage's contentplaceholder. Any thoughts?