<dataselectionmanager>
A selection manager for views generated by a lazily-replicated datapath

JavaScript: lz.dataselectionmanager

If a datapath's datapath.replication attribute is set to "lazy", then a match to multiple nodes will create an lz.LazyReplicationManager instead of an lz.ReplicationManager. The lazy replication manager creates only enough replicated views in order to display the data, so there is not a view for each data node. This enables the display of very large datasets.

With lazy replication you must use a lz.dataselectionmanager instead of a lz.selectionmanager. The lz.dataselectionmanager will operate on the data itself, instead of on the views (which may not be present if the data has scrolled out of view). For each dataset you are controlling, you can have only one lz.dataselectionmanager operating on it.

As with a lz.selectionmanager, ctrl-click will select multiple items and shift-click will select a range. To modify this behavior, you can extend the lz.dataselectionmanager and implement isRangeSelect and isMultiSelect.

<canvas width="200" height="200">
   <dataset name="mydata">
     <list>
       <item>tricycle</item>
       <item>train</item>
       <item>racecar</item>
       <item>scooter</item>
       <item>bicycle</item>
       <item>rollerblades</item>
       <item>iceskates</item>
       <item>minivan</item>
       <item>sailboat</item>
       <item>motorboat</item>
     </list>
   </dataset>
   <class name="selectme" onclick="immediateparent.selector.select(this)" height="17" width="100" bgcolor="white">
     <text datapath="text()"/>
     <method name="setSelected" args="isselected">
        if (isselected) setAttribute('bgcolor', yellow);
        else setAttribute('bgcolor', white);
     </method>
   </class>
   <view height="70" clip="true">
     <view>
       <dataselectionmanager name="selector"/>
       <selectme>
         <datapath xpath="mydata:/list/item/" replication="lazy"/>
       </selectme>
       <simplelayout/>
     </view>
     <scrollbar/>
     </view>
 </canvas>
edit

Attributes inherited from <selectionmanager>

sel, toggle

Methods

clearSelection()
dataselectionmanager.clearSelection();
Unselects everything that is currently selected and clears the selection list

getSelection()
dataselectionmanager.getSelection();
Returns a list of datapointers, which point to the selected records
Returns Type Description
  Array A list of datapointers

isSelected()
dataselectionmanager.isSelected(o : lz.view);
Tests whether the given view is selected
Parameter Name Type Description
o lz.view The view to test for selectedness
Returns Type Description
  Boolean The selectedness of the input object.

unselect()
dataselectionmanager.unselect(o : lz.view);
Unselect the given view
Parameter Name Type Description
o lz.view The view to be unselected

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy