10 - STDisplay - Speed Table Display Functions for the World Wide Web

From the speed table API, stDisplay, speed table display functions for the world wide web. This code is derived from Rivet's diodisplay.tcl.

set display [::STDisplay #auto ?-confvar value? ... \
    -table table ?-keyfields key_list?]

or

set display [::STDisplay #auto ?-confvar value? ... \
    -uri uri]

One of -table or -uri must be provided.

Options:

-table
Use already opened table.

If the table isn't STAPI-compatible it will use ::stapi::extend::connect to wrap it and in this case keyfields must be provided.

-uri
Use ::stapi::connect to connect to a ctable using a URI.

Any valid STAPI URI can be used.

-debug 0-9

Set debug level

-csvfile filename

Name of CSV file to generate.

-csvredirect 0|1

If enabled, then the CSV file is downloaded immediately using a redirect.

-key field_name

Field to use as a key

-title string

Title of table.

-arrows {up down}

Symbols or HTML fragments to use for ascending and descending sort of a table column.

-readonly 0|1

If true, this is a read-only table, clear the "Edit" and "Delete" functions.

-details 1|0

If true (default), provide the 'Details' function

-pagesize integer

Number of rows displayed per page.

-functions {Search List Add Edit Delete Details}

Functions shown on the top of the display.

-rowfunctions {Details Edit Delete}

Functions shown at the end of the row.

Methods for $display

$display show

Render all HTML for the page. Destroys $display.

$display destroy

Destroys $display

$display state

Returns a list of name-value pairs that represent the current state of the query, as CGI variables, for populating external links. The counterpart to hidden

$display functions {?Add? ?Show? ...}

Equivalent to the -functions configuration variable - enable global functions, to control the functions available in the search bar. The possible functions are Search, List, Add, Edit, Delete and Details.

$display rowfunctions {?Edit? ?Delete? ...}

Equivalent to the -rowfunctions configuration variable - enable row functions, to control the functions available in the search bar. The possible functions are Edit, Delete and Details.

$display field name ?-configvar value?...

Define a field

$display alias name ?field?

Define an alias for an existing field. Aliases are used to create multiple filtered columns based on the same field.

$display filter name ?proc? ?column?

Filter column name through [proc $value_of_field ...] before displaying. If any columns are provided the values of these columns will be appended to the filter.

$display csvfilter name ?proc? ?column?

Filter column name through [proc $value_of_field] on generating a CSV file, like filter.

$display unfilter name ?proc?

Filter entered text through [$proc text] before using to search table. This allows the user to enter (for example) a device name for a field that expects an IP address.

$display order name $order

Set sort order for field.

$display case name $case

Set whether the column can be matched uppercase or lowercase when doing a case-independent match.

$display hovertext name $text

Set text to be displayed when hovering the cursor over the title of the column.

$display blankval name $blank

Value to treat as a null value and display as an empty cell.

$display limit $limit

Set search terms to limit the displayed portion of the ctable. The limit is a list of {column_name value ?column_name value?}.

$display attributes name $attribute_list

Set attributes (eg "bgcolor=blue") for field

$display hidden $cgivar $value

This is used to pass any additional CGI variables the page will require through the links generated by STDisplay. This method may be invoked for each value