630ca7552c98b8fcc3bbe067dcf6cb62fcd8910a.svn-base 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <div class="body-wrap">
  2. <div class="top-tools">
  3. <a class="inner-link" href="#Ext.layout.TableLayout-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
  4. <a class="inner-link" href="#Ext.layout.TableLayout-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
  5. <a class="inner-link" href="#Ext.layout.TableLayout-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
  6. <a class="inner-link" href="#Ext.layout.TableLayout-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
  7. <a class="bookmark" href="../docs/?class=Ext.layout.TableLayout"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
  8. </div>
  9. <div class="inheritance res-block">
  10. <pre class="res-block-inner"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a>
  11. <img src="resources/elbow-end.gif"/>TableLayout</pre></div>
  12. <h1>Class Ext.layout.TableLayout</h1>
  13. <table cellspacing="0">
  14. <tr><td class="label">Package:</td><td class="hd-info">Ext.layout</td></tr>
  15. <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/TableLayout.js" target="_blank">TableLayout.js</a></td></tr>
  16. <tr><td class="label">Class:</td><td class="hd-info">TableLayout</td></tr>
  17. <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a></td></tr>
  18. </table>
  19. <div class="description">
  20. <p>This layout allows you to easily render content into an HTML table. The total number of columns can be
  21. specified, and rowspan and colspan can be used to create complex layouts within the table.
  22. This class is intended to be extended or created via the layout:'table' <a ext:cls="Ext.Container" ext:member="layout" href="output/Ext.Container.html#layout">Ext.Container.layout</a> config,
  23. and should generally not need to be created directly via the new keyword.</p>
  24. <p>Note that when creating a layout via config, the layout-specific config properties must be passed in via
  25. the <a ext:cls="Ext.Container" ext:member="layoutConfig" href="output/Ext.Container.html#layoutConfig">Ext.Container.layoutConfig</a> object which will then be applied internally to the layout. In the
  26. case of TableLayout, the only valid layout config property is <a ext:cls="Ext.layout.TableLayout" ext:member="columns" href="output/Ext.layout.TableLayout.html#columns">columns</a>. However, the items added to a
  27. TableLayout can supply table-specific config properties of <b>rowspan</b> and <b>colspan</b>, as explained below.</p>
  28. <p>The basic concept of building up a TableLayout is conceptually very similar to building up a standard
  29. HTML table. You simply add each panel (or "cell") that you want to include along with any span attributes
  30. specified as the special config properties of rowspan and colspan which work exactly like their HTML counterparts.
  31. Rather than explicitly creating and nesting rows and columns as you would in HTML, you simply specify the
  32. total column count in the layoutConfig and start adding panels in their natural order from left to right,
  33. top to bottom. The layout will automatically figure out, based on the column count, rowspans and colspans,
  34. how to position each panel within the table. Just like with HTML tables, your rowspans and colspans must add
  35. up correctly in your overall layout or you'll end up with missing and/or extra cells! Example usage:</p>
  36. <pre><code><i>// This code will generate a layout table that is 3 columns by 2 rows</i>
  37. <i>// <b>with</b> some spanning included. The basic layout will be:</i>
  38. <i>// +--------+-----------------+</i>
  39. <i>// | A | B |</i>
  40. <i>// | |--------+--------|</i>
  41. <i>// | | C | D |</i>
  42. <i>// +--------+--------+--------+</i>
  43. <b>var</b> table = <b>new</b> Ext.Panel({
  44. title: <em>'Table Layout'</em>,
  45. layout:<em>'table'</em>,
  46. defaults: {
  47. <i>// applied to each contained panel</i>
  48. bodyStyle:<em>'padding:20px'</em>
  49. },
  50. layoutConfig: {
  51. <i>// The total column count must be specified here</i>
  52. columns: 3
  53. },
  54. items: [{
  55. html: <em>'&lt;p&gt;Cell A content&lt;/p&gt;'</em>,
  56. rowspan: 2
  57. },{
  58. html: <em>'&lt;p&gt;Cell B content&lt;/p&gt;'</em>,
  59. colspan: 2
  60. },{
  61. html: <em>'&lt;p&gt;Cell C content&lt;/p&gt;'</em>
  62. },{
  63. html: <em>'&lt;p&gt;Cell D content&lt;/p&gt;'</em>
  64. }]
  65. });</code></pre> </div>
  66. <div class="hr"></div>
  67. <a id="Ext.layout.TableLayout-configs"></a>
  68. <h2>Config Options</h2>
  69. <table cellspacing="0" class="member-table">
  70. <tr>
  71. <th class="sig-header" colspan="2">Config Options</th>
  72. <th class="msource-header">Defined By</th>
  73. </tr>
  74. <tr class="config-row expandable">
  75. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  76. <td class="sig">
  77. <a id="Ext.layout.TableLayout-columns"></a>
  78. <b>columns</b> : Number <div class="mdesc">
  79. <div class="short">The total number of columns to create in the table for this layout. If not specified, all panels added to this layout...</div>
  80. <div class="long">
  81. The total number of columns to create in the table for this layout. If not specified, all panels added to this layout will be rendered into a single row using a column per panel. </div>
  82. </div>
  83. </td>
  84. <td class="msource">TableLayout</td>
  85. </tr>
  86. <tr class="config-row inherited alt expandable">
  87. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  88. <td class="sig">
  89. <a id="Ext.layout.TableLayout-extraCls"></a>
  90. <b>extraCls</b> : String <div class="mdesc">
  91. <div class="short">An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding custo...</div>
  92. <div class="long">
  93. An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding customized styles to the container or any of its children using standard CSS rules. </div>
  94. </div>
  95. </td>
  96. <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#extraCls" href="output/Ext.layout.ContainerLayout.html#extraCls">ContainerLayout</a></td>
  97. </tr>
  98. <tr class="config-row inherited">
  99. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  100. <td class="sig">
  101. <a id="Ext.layout.TableLayout-renderHidden"></a>
  102. <b>renderHidden</b> : Boolean <div class="mdesc">
  103. True to hide each contained item on render (defaults to false). </div>
  104. </td>
  105. <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#renderHidden" href="output/Ext.layout.ContainerLayout.html#renderHidden">ContainerLayout</a></td>
  106. </tr>
  107. </table>
  108. <a id="Ext.layout.TableLayout-props"></a>
  109. <h2>Public Properties</h2>
  110. <div class="no-members">This class has no public properties.</div> <a id="Ext.layout.TableLayout-methods"></a>
  111. <h2>Public Methods</h2>
  112. <div class="no-members">This class has no public methods.</div> <a id="Ext.layout.TableLayout-events"></a>
  113. <h2>Public Events</h2>
  114. <div class="no-members">This class has no public events.</div>
  115. </div>