4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 * @class Roo.ReaderLayout
15 * @extends Roo.BorderLayout
16 * This is a pre-built layout that represents a classic, 5-pane application. It consists of a header, a primary
17 * center region containing two nested regions (a top one for a list view and one for item preview below),
18 * and regions on either side that can be used for navigation, application commands, informational displays, etc.
19 * The setup and configuration work exactly the same as it does for a {@link Roo.BorderLayout} - this class simply
20 * expedites the setup of the overall layout and regions for this common application style.
23 var reader = new Roo.ReaderLayout();
24 var CP = Roo.ContentPanel; // shortcut for adding
27 reader.add("north", new CP("north", "North"));
28 reader.add("west", new CP("west", {title: "West"}));
29 reader.add("east", new CP("east", {title: "East"}));
31 reader.regions.listView.add(new CP("listView", "List"));
32 reader.regions.preview.add(new CP("preview", "Preview"));
36 * Create a new ReaderLayout
37 * @param {Object} config Configuration options
38 * @param {String/HTMLElement/Element} container (optional) The container this layout is bound to (defaults to
39 * document.body if omitted)
41 Roo.ReaderLayout = function(config, renderTo){
42 var c = config || {size:{}};
43 Roo.ReaderLayout.superclass.constructor.call(this, renderTo || document.body, {
44 north: c.north !== false ? Roo.apply({
49 west: c.west !== false ? Roo.apply({
57 margins:{left:5,right:0,bottom:5,top:5},
58 cmargins:{left:5,right:5,bottom:5,top:5}
60 east: c.east !== false ? Roo.apply({
68 margins:{left:0,right:5,bottom:5,top:5},
69 cmargins:{left:5,right:5,bottom:5,top:5}
76 margins:{left:c.west!==false ? 0 : 5,right:c.east!==false ? 0 : 5,bottom:5,top:2}
80 this.el.addClass('x-reader');
84 var inner = new Roo.BorderLayout(Roo.get(document.body).createChild(), {
85 south: c.preview !== false ? Roo.apply({
92 cmargins:{top:5,left:0, right:0, bottom:0}
93 }, c.preview) : false,
100 this.add('center', new Roo.NestedLayoutPanel(inner,
101 Roo.apply({title: c.mainTitle || '',tabTip:''},c.innerPanelCfg)));
105 this.regions.preview = inner.getRegion('south');
106 this.regions.listView = inner.getRegion('center');
109 Roo.extend(Roo.ReaderLayout, Roo.BorderLayout);