Class SimpleGUIDataList

Description

This object is the base class that can be

used to build a widget that shows lists of data from any source via the DataListSource object. It fetches/builds/gets its data from the DataListSource object, which can be written to support any data source (MySQL, Oracle, comma delimited file, xml, etc.)

This base class MUST be extended by a child to actually render the list. The job of the DataList class is to provide the basic API and abstraction mechanism to handling searching, showing, sorting lists of data.

Each column of data is associated with a title and a name. The title is what is shown to the user for that column. The name is the mapping between the column and the DataListSource. Each column can be marked as sortable and searchable. If a column is sortable, the title is a link that can be clicked on to sort. The sorting is done in the DataListSource object ( via the sql query, or sort() functions depending on the data source itself)

The DataList object will build the title, the search block (if any), the datalist controls (the links/imges for first, prev, next, last, all). Then the data columns/labels. Then it will fetch each of the rows of data to display from the DataListSource.

The logic of the output calls follows in the order:

title search table/block datalist controls (first, prev, next, last, all) data columns/labels data rows x through y

REQUIREMENTS: You must use/define a DataListSource object. You MUST override/extend the following methods:

* get_data_source() - used to set the DataListSource by this class. * user_setup() - used to set the columns to show and any options used by the DataList class and DataListSource object.

UI ABSTRACTION METHODS These methods allow for some level of abstraction for the layout/look/feel of the actual list of data.

* gui_init() - the function gives the child class a chance to do any building of the objects that will hold the search area, column headers and the rows of data.

* child_build_column_header() - This method is responsible for building and inserting the column header title into the UI object.

* child_add_row_cell() - This function is responsible for adding the cell in the current row. The method is responsible for keeping track of the location in its UI object for the current row.

* child_get_gui() - This method returns the entire UI in 1 object or container. At this point the entire UI has been constructed, the entire list of data has been walked and inserted.

Located in /widgets/data_list/SimpleGUIDataList.inc (line 15)

Container
   |
   --BaseWidget
      |
      --DataList
         |
         --SimpleGUIDataList
Method Summary
mixed build_column_header (string $col_name, array $col_data, int $col_num)
void child_add_row_cell ( $obj,  $col_name,  $last_in_row_flag,  $row_data)
void child_build_column_header ( $name,  $col,  $cnt)
void child_get_gui ()
void gui_init ()
TDtag wrap_column_item (mixed $obj, string $col_name, int 2, int 3)
Variables
Methods
build_column_header (line 74)

This function builds the object/text

to be used for a column header. It can either be an href because its sortable, or it can just be text, because its not sortable.

  • return: - either an Atag object or raw text.
mixed build_column_header (string $col_name, array $col_data, int $col_num)
  • string $col_name: - the column name to build from the headers.
  • array $col_data: - the column's data.
  • int $col_num: the column # we are working on.
child_add_row_cell (line 48)
void child_add_row_cell ( $obj,  $col_name,  $last_in_row_flag,  $row_data)
  • $obj
  • $col_name
  • $last_in_row_flag
  • $row_data

Redefinition of:
DataList::child_add_row_cell()
This method is supposed to be written by the child class to add the cell data to the current row in the UI
child_build_column_header (line 42)
void child_build_column_header ( $name,  $col,  $cnt)
  • $name
  • $col
  • $cnt

Redefinition of:
DataList::child_build_column_header()
This method is supposed to be written by the child class to build and add the column title to the UI
child_get_gui (line 38)
void child_get_gui ()

Redefinition of:
DataList::child_get_gui()
This function is called after all of the data has been added to the UI object. It just returns the container that is the entire UI for the DataList
gui_init (line 21)

Initialize the gui layout

void gui_init ()

Redefinition of:
DataList::gui_init()
A subclass can override this function to setup the class variables after the constructor. The constructor automatically calls this function.
wrap_column_item (line 99)

This function ensures that the data we place in a column is aligned according to what the user wants.

  • return: object
TDtag wrap_column_item (mixed $obj, string $col_name, int 2, int 3)
  • int 2: - $odd_row - tells us if this cell lives in an odd # row (for alternating row colors)
  • int 3: - the column # we are working on.
  • mixed $obj: - $obj - the data for the td.
  • string $col_name: - $col_name - the name of the column header for this row to render.

Inherited Methods

Inherited From DataList

DataList::DataList()
DataList::add_header_item()
DataList::advanced_search_disable()
DataList::advanced_search_enable()
DataList::build_base_url()
DataList::build_column_item()
DataList::build_column_url()
DataList::build_gui()
DataList::build_orderby_querystring()
DataList::build_reverseorder_querystring()
DataList::build_searchfield_querystring()
DataList::build_searchvalue_querystring()
DataList::build_state_vars_query_string()
DataList::build_tool_link()
DataList::child_add_row_cell()
DataList::child_build_column_header()
DataList::child_build_search_table()
DataList::child_get_gui()
DataList::data_prefetch()
DataList::do_action()
DataList::expandrows()
DataList::filter_column_string()
DataList::get_cleanstring()
DataList::get_current_page()
DataList::get_data_source()
DataList::get_default_num_rows()
DataList::get_form_action()
DataList::get_form_method()
DataList::get_form_name()
DataList::get_form_render()
DataList::get_form_target()
DataList::get_global_prefix()
DataList::get_image_path()
DataList::get_last_page()
DataList::get_max_rows()
DataList::get_not_found_message()
DataList::get_num_pages()
DataList::get_page_info()
DataList::get_showall()
DataList::get_simple_search_modifier()
DataList::gui_init()
DataList::is_advanced_search_enabled()
DataList::is_search_enabled()
DataList::numrows()
DataList::offset()
DataList::orderby()
DataList::pre_query_sanity_check()
DataList::render()
DataList::reverseorder()
DataList::search_disable()
DataList::search_enable()
DataList::search_field()
DataList::search_type()
DataList::search_value()
DataList::search_value_filter()
DataList::setup_columns()
DataList::set_cleanstring()
DataList::set_data_source()
DataList::set_debug()
DataList::set_default_num_rows()
DataList::set_expandrows()
DataList::set_form_action()
DataList::set_form_method()
DataList::set_form_name()
DataList::set_form_render()
DataList::set_form_target()
DataList::set_global_prefix()
DataList::set_image_path()
DataList::set_max_rows()
DataList::set_not_found_message()
DataList::set_numrows()
DataList::set_offset()
DataList::set_orderby()
DataList::set_reverseorder()
DataList::set_save_vars()
DataList::set_search_type()
DataList::set_showall()
DataList::set_show_results()
DataList::set_simple_search_modifier()
DataList::simple_search_modifier_value()
DataList::user_setup()
DataList::_build_default_vars()
DataList::_build_save_vars()
DataList::_build_simple_search_modifier()
DataList::_build_tool_url()
DataList::_check_datasource()
DataList::_clean_string()
DataList::_filter_column_string()
DataList::_get()
DataList::_get_searchable_fields()
DataList::_javascript()
DataList::_save_mozilla_nav_link()
DataList::_set()
DataList::_show_results()

Inherited From BaseWidget

BaseWidget::get_align()
BaseWidget::get_css()
BaseWidget::get_javascript()
BaseWidget::get_title()
BaseWidget::get_width()
BaseWidget::set_align()
BaseWidget::set_image_path_prefix()
BaseWidget::set_title()
BaseWidget::set_width()

Inherited From Container

Container::Container()
Container::add()
Container::add_reference()
Container::count_content()
Container::get_element()
Container::get_indent_flag()
Container::push()
Container::push_reference()
Container::render()
Container::reset_content()
Container::set_collapse()
Container::set_indent_flag()

Documentation generated on Fri, 28 Jan 2011 08:53:12 -0500 by phpDocumentor 1.4.3