_showSome
Show some of the contents at a time --
Function
The same Type -> _showSome
(start, len, label, ql, render) -> Value has not been set
- Receives -- The same Type
- A value that will be passed to the parameters.
- start
- The index to begin listing from, usually 0
- len
- The number of entries to show
- label
- The text to display on the link to show more.
- ql
- The QL that lists all of the desired entries.
- render
- QL describing how to display the entries that will be shown this time.
- Produces
- The current subset of all of the entries.
This is a useful but complex function for dealing with long lists. Given some incoming context,
it runs the expression in ql
to compute a bunch of expressions. It produces a List of len
of them
with indexes starting at start
, feeds that to render
, and produces the result of that. The whole
thing will be finished with label
; clicking on that produces the next len
items.
The division between ql
and render
is a bit subtle, and is mainly for efficiency. ql
should
contain the code up until the order is clear -- typically until _sort. You can put everything
into ql
, but it will run more slowly, because it will do all the render processing for everything,
including the entries that aren't being shown right now. (That is, when it shows "some", it will
run the ql
, and then only run render
on the entries to be displayed.)
In the long run, this should be replaced by a cleverer and more automatic mechanism. Also, this
may be replaced by a QL function in due course. So consider this experimental; it may go away
down the line.