Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)

Objective: Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5).

Steps:

Step 1. Supporting Work
Step 2. Data Store Implementation
Step 3. Create Tables

Step 1. Supporting Work

We're going to be calling a Service to get each page of data for our Table. The out-the-box client-side Javascript only provisions for asynchronous calls but our approach requires a synchronous call. We can create our own synchronous versions of the out-the-box functions...


Step 2. Data Store Implementation

Dojo provides many Data Stores but, unfortunately, none of them quite fit what we want to do. Fortunately, it's quite easy to extend the "QueryReadStore" (in particular the "_fetchItems()" function) to give us what we want...


Note that the function to actually do the lazy-loading is a parameter. This means that we can easily re-use our Data Store. Here's an example of a lazy-loading function...


Note 1: The "snapShotId" is set on the report using something like this...


Note 2: The total number of rows is included as a column in the result set. It could easily be a separate parameter.

Step 3. Create Tables

Now we're ready to create the DataGrids. You can write your own code to do this but here's mine...






comments powered by Disqus