lz.ResizeReplicationManager
An optimization for displaying large sets of data that allows the elements to resize.

JavaScript: lz.ResizeReplicationManager

The lz.ResizeReplicationManager extends the capabilities of the lz.LazyReplicationManager so that the elements in the replication can be resized in their axis. All of the restrictions on the use of the lz.LazyReplicationManager apply to the lz.ResizeReplicationManager except for this one:

  • The replicated view can change its size in the replication axis, and the size can be a constraint. Resize replication should work in all cases, even those in which the replicated view is sized by its contents.

Note that the performance of a resize replication manager is related to the number of items displayed and the length of the data, whereas the lazy replication manager performance is only determined by the number of items displayed.

Example 13. Using a resize replication manager to display a large dataset when the elements resize

<canvas height="200">
     <dataset name="vegetables">
         <celery/> <celeriac/> <carrot/> <florence_fennel/> <parsnip/>
         <parsley/> <winter_endive/> <witloof_chicory/> <cardoon/>
         <artichoke/> <head_lettuce/> <cos_lettuce/> <black_salsify/>
         <swedish_turnip/> <cauliflower/> <cabbage/> <brussels_sprouts/>
         <kohlrabi/> <broccoli/> <savoy_cabbage/> <turnip/> <radish/>
         <water_cress/> <garden_cress/> <foliage_beet/> <spinach/>
         <sweet_potato/> <watermelon/> <melon/> <cucumber/> <winter_squash/>
         <marrow/> <chickpea/> <lentil/> <runner_bean/> <common_bean/>
         <pea/> <faba_bean/> <leek/> <shallot/> <onion/> <salsify/>
         <welsh_onion/> <garlic/> <chives/> <asparagus/> <ladyfinger/>
         <sweet_corn/> <rhubarb/> <capsicum_pepper/> <tomato/> <eggplant/>
     </dataset>

     <simplelayout spacing="10"/>
     <text width="200" oninit="countSubviews()">
         <handler name="onaddsubview" reference="replicationParent">
             countSubviews();
         </handler>
         <method name="countSubviews">
             this.format("number of subviews: %d",
                         replicationParent.subviews.length);
         </method>
     </text>

     <view clip="true" width="200" height="160" id="clipper">
         <view id="replicationParent">
             <view bgcolor="#CCCCFF" height="15">
                 <datapath xpath="vegetables:/* /name()" spacing="5" replication="resize"/>

                 <text datapath="name()" valign="middle"/>
                 <handler name="onclick">
                     if ( this.height != 40 ){
                         this.animate ( 'height', 40 , 500 );
                     } else {
                         this.animate ( 'height', 15 , 500 );
                     }
                 </handler>
             </view>
         </view>
         <scrollbar/>
     </view>
 </canvas>

Attributes inherited from lz.ReplicationManager

clones, nodes, visible

Attributes inherited from <datapath>

axis, pooling, replication, sortorder, sortpath, spacing

Attributes inherited from <datapointer>

context, p, rerunxpath, xpath

Methods

Methods inherited from <datapath>

setNodes, setSelected, updateData

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <datapointer>

onerror, ontimeout

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy