layout/xul/grid/examples/collapsetest.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/xul/grid/examples/collapsetest.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +<?xml version="1.0"?> 
     1.5 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     1.8 +
     1.9 +
    1.10 +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
    1.11 +
    1.12 +<!DOCTYPE window> 
    1.13 +
    1.14 +
    1.15 +<window orient="vertical" style="border: 2px solid green"
    1.16 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
    1.17 +
    1.18 +<script>
    1.19 +
    1.20 +   function collapseTag(id)
    1.21 +   {
    1.22 +     var row = window.document.getElementById(id);
    1.23 +	 row.setAttribute("collapsed","true");
    1.24 +   }
    1.25 +
    1.26 +   function uncollapseTag(id)
    1.27 +   {
    1.28 +     var row = window.document.getElementById(id);
    1.29 +	 row.setAttribute("collapsed","false");
    1.30 +   }
    1.31 +
    1.32 +
    1.33 +</script>
    1.34 +
    1.35 +    <hbox>
    1.36 +		<grid style="border: 2px solid red;" id="grid">
    1.37 +		   <columns id="columns1">
    1.38 +		      <column id="column1"/>
    1.39 +		      <column id="column2"/>
    1.40 +		      <column id="column3"/>
    1.41 +		   </columns>
    1.42 +
    1.43 +		   <rows id="rows1" style="font-size: 24pt">
    1.44 +			 <row id="row1">
    1.45 +			    <text value="cell1"/>
    1.46 +			    <text value="cell2"/>
    1.47 +			    <text value="cell3"/>
    1.48 +			 </row>
    1.49 + 			 <row id="row2">
    1.50 +			    <text value="cell4"/>
    1.51 +			    <text value="cell5"/>
    1.52 +			    <text value="cell6"/>
    1.53 +			 </row>
    1.54 +			 <row id="row3">
    1.55 +			    <text value="cell7"/>
    1.56 +			    <text value="cell8"/>
    1.57 +			    <text value="cell9"/>
    1.58 +			 </row>
    1.59 +		   </rows>
    1.60 +		</grid>
    1.61 +    </hbox>
    1.62 +	<hbox>
    1.63 +	  <button label="collapse row 2"   oncommand="collapseTag('row2');"/>
    1.64 +	  <button label="uncollapse row 2" oncommand="uncollapseTag('row2');"/>
    1.65 + 	  <button label="collapse column 2"   oncommand="collapseTag('column2');"/>
    1.66 +	  <button label="uncollapse column 2" oncommand="uncollapseTag('column2');"/>
    1.67 +
    1.68 +	</hbox>
    1.69 +
    1.70 +</window>

mercurial