nrsTable Class Reference

List of all members.

Public Member Functions

void nextPage ()
void moveSortArrow (void field)
void fieldSort (void field)
void gotoPage (void page)
void newData (void new_data, void cell_links, void row_links)
void prevPage ()
void refreshTable ()
void changeNumRows (void entries)
void firstPage ()
void createDataNodes ()
void lastPage ()
void updateNav ()
void extractElements ()
void recolorRows ()
void emptyTable ()
void insertElements ()
void flipSortArrow ()
void quickSort (void left, void right)
void buildTable ()

Detailed Description

This is the constructor. It only needs the name of the table. This should never be called directly, instead use setup function.
Parameters:
table The name of the table to create.
See also:
setup


Member Function Documentation

void nrsTable::buildTable  )  [inline]
 

This function builds a brand new table from scratch. This function should only be called when a brand new table (with headers, footers, etc) needs to be created. NOT when refreshing data or changing data.

void nrsTable::changeNumRows void  entries  )  [inline]
 

This function can be used to change the number of entries per row displayed on the fly.

Parameters:
entries The number of entries per page.

void nrsTable::createDataNodes  )  [inline]
 

This function will create the Data Nodes, which are a reference to the table rows in the HTML.

void nrsTable::emptyTable  )  [inline]
 

This function completely destroys a table. Should be used only when building a brand new table (ie, new headers). Else you should use a function like buildNewData which only deletes the TBody section.

void nrsTable::extractElements  )  [inline]
 

This function will remove the elements in teh TBody section of the table and return an array of references of those elements. This array can then be sorted and re-inserted into the table.

Returns:
An array to references of the TBody contents.

void nrsTable::fieldSort void  field  )  [inline]
 

This function will sort the table's data by a specific field. The field parameter referes to which field index should be sorted.

Parameters:
field The field index which to sort on.

void nrsTable::firstPage  )  [inline]
 

This function will go to the first page.

void nrsTable::flipSortArrow  )  [inline]
 

This function will flip the sort arrow in place. If a heading is used in the footer, then it will flip that one too.

void nrsTable::gotoPage void  page  )  [inline]
 

This function will go to a specific page. valid values are pages 1 to however many number of pages there are.

Parameters:
page The page number to go to.

void nrsTable::insertElements  )  [inline]
 

This function will re-insert an array of elements into the TBody of a table. Note that the array elements are stored in the this.data_nodes reference.

void nrsTable::lastPage  )  [inline]
 

This function will go to the last page.

void nrsTable::moveSortArrow void  field  )  [inline]
 

This function will move the sorting arrow from the place specified in this.field_to_sort to the passed parameter. It will also set this.field_to_sort to the new value. It will also do it in the footers, if they exists.

Parameters:
field The new field to move it to.

void nrsTable::newData void  new_data,
void  cell_links,
void  row_links
[inline]
 

This function will take in a new data array and , optionally, a new cell_link array OR a new row_link array. Only one will be used, with the cell_link array taking precedence. It will then re-build the table with the new data array.

Parameters:
new_data This is the new data array. This is required.
cell_links This is the new cell links array, a 2D array for each cell.
row_links This is the new row links array, a 1D array for each row.

void nrsTable::nextPage  )  [inline]
 

This function will advance a page. If we are already at the last page, then it will remain there.

void nrsTable::prevPage  )  [inline]
 

This function will go back a page. If we are already at the first page, then it will remain there.

void nrsTable::quickSort void  left,
void  right
[inline]
 

This is hte Javascript quicksort implementation. This will sort the this.data and the this.data_nodes based on the this.field_to_sort parameter.

Parameters:
left The left index of the array.
right The right index of the array

void nrsTable::recolorRows  )  [inline]
 

This function will recolor all the the nodes to conform to the alternating row colors.

void nrsTable::refreshTable  )  [inline]
 

This function will refresh the data in the table. This function should be used whenever the nodes have changed, or when chanign pages. Note that this will NOT re-sort.

void nrsTable::updateNav  )  [inline]
 

This function will update the nav page display.


The documentation for this class was generated from the following file:
Generated on Tue Dec 13 08:43:36 2005 for nrsTable by  doxygen 1.4.5