sortable_table

EveAndersson.com : API Browser : sortable_table

sortable_table

sortable_table db select_string display_spec vars_to_export sort_var \
    current_sort_order [ table_length ] [ extra_table_parameters ] \
    [ stripe_color_list ] [ max_results ] [ header_font_params ] \
    [ row_font_params ]
Defined in packages/acs-core/deprecated-utilities-procs.tcl

Procedure to format a database query as a table that can be sorted by clicking on the headers. Arguments are:

  • db: database handle
  • select_string: SQL statement that selects all columns that will be displayed in the table.
  • display_spec: a "display specification" that consists of a list of column specs. Column specs are lists with the following elements:
    1. primary column name (name of column which determines sorting for this table column)
    2. header (header to display for this column)
    3. display string (optional; if provided, a string with variable references to column names that will be interpolated for each row)
    4. default sort order (optional; really used to say when something needs to sort "desc" by default instead of "asc")
    5. column width (optional).
  • vars_to_export: an ns_set of variables to re-export to the current page. Generally, [ns_conn form]
  • sort_var: a variable name which stores the sorting information for this table. You can use different sort_vars for multiple sortable tables in the same page.
  • current_sort_order: a list of column names that determine the current sorting order. Each element is either a column name that can be optionally followed by " desc" to specify descending order. Generally, just the current value of $sort_var.
  • table_length (optional): where to insert table breaks. Leaving unspecified or empty specifies no table breaks.
  • extra_table_parameters: Any extra parameters to go in the <table> tag
  • stripe_color_list: a list of color specifications for table striping. If specified, should specify at least two, unless a single color is desired for every row.
  • max_results (optional): Indicates to truncate table after so many results are retreived.
  • header_font_params (optional): Sets the font attributes for the headers.
  • row_font_params (optional): Sets the font attributes for any old row.

Parameters:
db
select_string
display_spec
vars_to_export
sort_var
current_sort_order
table_length (optional)
extra_table_parameters (optional)
stripe_color_list (optional)
max_results (optional)
header_font_params (optional)
row_font_params (optional)
[ show source ]

Show another procedure:

eve@eveandersson.com