4.23.1Class DataTable

Service rendering data from a DataManager as a table.

Class DataTable( instance ) from \
                 DataService(( instance))

This service uses a Data Manager to generate a table of data retreived from a database.

The

Properties
back_actActions to be rendered after each item.
cntGet given record count
default_cntStart at given record number
front_actActions to be rendered in front of each item.
recordsExtracted data as a DBRecord vector
startStart at given record number
table_actGlobal actions for the table.
Methods
do_queryReimplementation to perform the required query
getTableParamsReturns the paramters needed to create links to the section of this page.
makeCursorLinksCreates a cursor around the current position.
makeLinkToReturns a link to the current page adding the field needed to change the start point of this table.
makePageLinksCreates an array of links pointing to the partitions of this table.

Properties

back_act

Actions to be rendered after each item.

cnt

Get given record count

default_cnt

Start at given record number

front_act

Actions to be rendered in front of each item.

records

Extracted data as a DBRecord vector

start

Start at given record number

table_act

Global actions for the table.

Methods

do_query

Reimplementation to perform the required query

do_query()

getTableParams

Returns the paramters needed to create links to the section of this page.

getTableParams()
ReturnA triplet of values: first record, record per page and record count.

makeCursorLinks

Creates a cursor around the current position.

makeCursorLinks( name, direction, [multiple],[extraFields],[force] )
name A description for the direction (i.e. "previous" or "more"); must include the variable $(count).
direction True for forward (next), false for backward (previous).
multiple Array of other intervals to be returned.
extraFields An optional dictionary of variable->value to be repeated in the link.
force Generate the links even if leading to an impossible location.
ReturnAn array of string pairs [description, link] to be shown by the skin, or nil if none can be generated

This function creates one or more page swapper link to go to the next page or to the next N pages. Passing an array of numbers in multiple, the corresponding link to the next (or previous) nth. page is created as well. For example, passing [1, 10, 25, 50, 100, 1000] the function will create the links to reach the next 1, 10, 25, 50, 100 and 1000 pages.

Note: The multiple count must be expressed in pages, but the values rendered for display will be in items.

If force is not set to true, the link to the pages will be generated only if the pages would be actually reachable.

Note: Name must contain a "$(count)" marker that is expanded with the numeric value currently used as step.

makeLinkTo

Returns a link to the current page adding the field needed to change the start point of this table.

makeLinkTo( begin, [extraFields] )
begin First record to be shown (0 based).
extraFields An optional dictionary of variable->value to be repeated in the link.

makePageLinks

Creates an array of links pointing to the partitions of this table.

makePageLinks( topName, bottomName, preCount, postCount, [extraFields] )
topName Text for the "begin" marker.
bottomName Text for the "bottom" marker.
preCount Maximum count of direct links to be shown to reach the first preCount pages.
postCount Maximum count of direct links to be shown to reach the last posCount pages.
extraFields An optional dictionary of variable->value to be repeated in the link.
ReturnAn array of string pairs [description, link] to be shown by the skin.

If preCount is 0, then the link for all the pages will be generated.

If postCount is 0, then only the last page will be generated.

If there are some pages skipped in the middle between pre-count first N pages and postCount last N pages, the place will be marked with an entry [nil, nil].

The caller may insert the current cursor rendering in this position. If the current position falls within one of the rendered pages, the link (second field) will be oob'd.

The method will return Nil if there aren't pages to be shown.

See also: DataTable.

Made with http://www.falconpl.org