CGI::Widget::DBI::Search::Display::Table - HTML table display class for Search widget
my $ws = CGI::Widget::DBI::Search->new(q => CGI->new); ... $ws->{-display_class} = 'CGI::Widget::DBI::Search::Display::Table'; # or instead, simply: $ws->{-display_mode} = 'table'; # note: this is default behavior for the search widget, so this is all just for # informational purposes, e.g. to write your own display class
This class displays search results retrieved in the search widget in table format, much like the output from a typical relational database client. The dataset can be sorted via column header anchor tags, and paging links appear on all corners of the table display, as well as a list of navigable page ranges at bottom center.
Builds HTML table rows for current page in the dataset, including a header row with the visible columns with sortable columns as clickable anchor tags.
Builds data in object variables:
dataset_rows_html header_columns header_html
Called by render_dataset() to render just the column headers (along with sort links) for the most recent search.
Returns HTML rendering of current page in search results, along with navigation links.
Returns HTML rendering of given $row in dataset: '<tr> ... </tr>'. Calls display_field($row, $header_col) for each header column.
Returns HTML rendering of given $row / $col in dataset: '<td> ... </td>'. Calls display_record($row, $col), inherited from CGI::Widget::DBI::Search::AbstractDisplay for the cell contents.
CGI::Widget::DBI::Search::AbstractDisplay
To install CGI::Widget::DBI::Search, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Widget::DBI::Search
CPAN shell
perl -MCPAN -e shell install CGI::Widget::DBI::Search
For more information on module installation, please visit the detailed CPAN module installation guide.