grid.lzx
<library>
<include href="base/basegrid.lzx"/>
<include href="gridtext.lzx"/>
<include href="scrollbar.lzx"/>
<include href="utils/layouts/simplelayout.lzx"/>
<class name="grid" extends="basegrid">
<attribute name="showhscroll" value="true
"/>
<attribute name="showvscroll" value="true
"/>
<attribute name="needshscroll" value="${ header.width < header.hcontent.width }"/>
<attribute name="_showHeaderFill" value="${!sizetoheader}"/>
<attribute name="layout" value="placement : 'hcontent';axis:'x' ; spacing:-1
"/>
<attribute name="_columnclass" value="lz.gridtext
"/>
<scrollbar placement="content" name="_scrx" visible="${parent.showvscroll}"/>
<scrollbar name="_scry" axis="x" scrolltarget="classroot.header.hcontent" visible="${ parent.showhscroll && parent.needshscroll && parent.sizetoheader == false}"/>
<state applied="${ parent._showHeaderFill }">
<button clickable="false" placement="header" x="${ immediateparent.hcontent.width }" width="${classroot['_scrx'] ? Math.max(classroot['_scrx'].width, parent.width - this.x) : parent.width - this.x}" focusable="false"/>
</state>
<method name="init">
//need to cheat up the content because the button size is too big
//b/c of its highlight state
mainlayout.setAttribute( 'spacing' , -1);
super.init();
</method>
<doc>
<tag name="shortdesc"><text>
Presents a grid backed by a datasource.
</text></tag>
<text>
<p>A <classname>grid</classname> is used to present data in a
dataset. Although it can be configured using
<tagname>gridcolumn</tagname> and <tagname>gridtext</tagname>, by
default it will present one editable field for each attribute in
the first data node in the grid. If no attributes are found, a column
will be presented for the each of the <code>name()</code> and
<code>text()</code> fields of the nodes using
<classname>gridtext</classname> columns.</p>
<example>
<canvas height="250">
<dataset name="weatherdata" request="true"
src="http://www.laszlosystems.com/cgi-pub/weather.cgi?zip=10022"/>
<grid datapath="weatherdata:/weather" contentdatapath="forecast/day"/>
</canvas>
</example>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes
- <class name="grid" extends="basegrid">