<basegrid>
An abstract row-based container for data elements.

JavaScript: lz.basegrid
extends <basecomponent> » <view> » <node> » lz.Eventable »

basegrid is an abstract container for row-based data stored in a dataset. Because basegrid uses lazy replication, it is an efficient way to present large datasets, and it abstracts some of the complications involved in maintaining a selection within a dataset.

<canvas height="150">
              <dataset name="contacts" request="true" src="http:resources/contactsdata.xml"/>
            
              <basegrid datapath="contacts:/resultset" width="200" height="150">
                <basegridcolumn>
                  <text placement="header">Check 'em off</text>
                  <checkbox text="$path{ '@displayname'}" value="$path{'@checked'}">
                    <handler name="onvalue">
                      this.parent.parent.datapath.updateData();
                    </handler>
                  </checkbox>
                </basegridcolumn>
                <scrollbar placement="content"/>
              </basegrid>
            </canvas>
An abstract container for data rows, relying on lazy replication to make it possible to display large datasets.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
bgcolor0 color Color null read/write
  If given, sets the bgcolor for even numbered rows. If not given, the bgcolor for these rows is taken from the style's bgcolor.
bgcolor1 color Color null read/write
  If given, sets the bgcolor for odd numbered rows. If not given, the bgcolor for these rows is taken from the style's bgcolor.
columns expression any null read/write
  An array holding the basegridcolumns used by this grid
contentdatapath string String * read/write
  The datapath to use for the contents of the grid. By default, this is set to "*", meaning all of the nodes underneath the datacontext of the grid.
hilite expression any null read/write
  The view which is currently hilited.
multiselect expression any true read/write
  If true, the list will allow for multiple selection, and the getSelection method will always return a list. If false, only single selection is allowed.
rowheight number Number null read/write
  Optional height for the rows contained by the grid. If no value is given for this attribute, it will be set to the calculated height of rows.
selectable expression any true read/write
  If false, the rows are not clickable and the grid does not support selection.
showhlines boolean boolean false read/write
  If true, lines will be drawn (in component's style's bordercolor) vertically at each at each column division. This attribute can be set after instantiation.
shownitems expression any -1 read/write
  Sets the height of the grid to show a maximum of 'n' items.
showvlines boolean boolean false read/write
  If true, lines will be drawn (in component's style's bordercolor) horizontally at each at each row division. This attribute cannot be set after instantiation.
sizetoheader expression any null read/write
  A boolean. If true, the grid will keep its width set to the size of the header. This is automatically set to true for grids that do not have a set width. This is initially set to 0, which means that it is not true, but if it is explicitly set to false, the automatic behavior will be disabled for grids with no set width.
spacing number Number 0 read/write
  Spacing between the rows.

Methods

clearSelection()
basegrid.clearSelection();
Clear the current selection.

clearSort()
basegrid.clearSort();
Removes the current sort if one is set, and restores the original order of the dataset.

getIndexForItem()
basegrid.getIndexForItem(item : basegridrow);
Get the index for an item.
Parameter Name Type Description
item basegridrow the item for which to find the index

getItem()
basegrid.getItem(data : lz.Datanode);
Find a particular item by its data node.
Parameter Name Type Description
data lz.Datanode the data for the item to get.

getItemAt()
basegrid.getItemAt(index : Number);
Get a particular item by its index.
Parameter Name Type Description
index Number the index for the item to get.
Returns Type Description
  basegridrow the item found, or null, if not.

getNumItems()
basegrid.getNumItems();
Get the number of items in the list.
Returns Type Description
  Number number of items.

getSelection()
basegrid.getSelection();
Get the selection for the list.
Returns Type Description
  Object null if no selection, an LzDatapointer if single select, or an array of LzDatapointers if multiselect (default).

removeItemAt()
basegrid.removeItemAt(index : Number);
Find the item at the specified index and remove it from the list.
Parameter Name Type Description
index Number the index of the item to remove.

select()
basegrid.select(item : basegridrow);
Select an item.
Parameter Name Type Description
item basegridrow the basegridrow to select (may be an array when multiselect == true)

selectItem()
basegrid.selectItem(data : lz.Datanode);
Select an item by its datanode.
Parameter Name Type Description
data lz.Datanode the data of the item to select.

selectItemAt()
basegrid.selectItemAt(index : Number);
Select an item by index.
Parameter Name Type Description
index Number the index of the item to select.

selectNext()
basegrid.selectNext();
Move the selection to the next view.

selectPrev()
basegrid.selectPrev();
Move the selection to the previous view.

setContentdatapath()
basegrid.setContentdatapath(cdp);
Parameter Name Type Description
cdp    

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onselect Event sent when the grid selection changes.

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy