This Example demonstrates an important feature of the Flexicious Ultimate, that is Partial Lazy Load. By this we mean, loading a specific number of top level records upfront, and then go back to the service layer to load details when the user clicks on an expand icon related to the item.

 

The property of interest here is:

 

itemLoadMode: The Item Load Mode. Can be either "server" or "client". In client mode, the grid will assume that the children of items at this level are prefreched. In server mode, the grid will dispatch a ITEM_LOAD event (itemLoad) that should be used to construct an appropriate query to be sent to the backend, to retrieve the child objects at this level. Once the results are retrieved, please call the "setChildData" method on the grid to set the results at this level.

 

You will notice that the itemLoadMode for the top level in this example is server. This means, that the grid will always assume that there are children below this level, and will issue a "itemLoad" event when the user clicks on the disclosure icon for any row at this level. In the itemLoad event, we load the details for the organization in question, and when we get the results back, we simply call the setChildData function. Please note, the "childrenField" is still required at this level, because that is where the setChildData method persists the loaded children. Future itemOpen events do not result in itemLoads because the data for this particular entity has already been loaded and persisted.

 

In this example, we have seen how to wire up a partially lazy loaded Hierarchical DataGrid. That is, we load up the top level with no children records, and then lazy load them in as the user clicks on expand. Please note, it is not advisable to set enableDrillDown on lazy loaded grids, because this will result in too many server calls being issued.

 

The rest of the markup is similar to the NestedData example, so it is not being discussed here seperately.