![]() |
Framework
3.9
|
GroupedDataListView displays a list of DataItems (or InnerJoinResults) in tabular format grouped by a specific field. More...
Public Member Functions | |
GroupedDataListView ($items, $id, $cssClass="list", $groupClass="subheading") | |
Creates a new GroupedDataListView object. More... | |
getID () | |
addFacetTaggingHandler ($handler) | |
Adds a row tagging handler. More... | |
group ($title, $key, $expanded=false, $fixed=false) | |
Adds a group to the view. More... | |
groupBy ($groups, $format=null, $field="", $expandedFn=null, $fixedFn=null) | |
Add groups based on the supplied list of DataItems. More... | |
autoGroup () | |
format ($group, $template) | |
Outputs the text for the groupedBy title bar using the given group dataitem object. More... | |
scrollable ($height=300, $resizable=true) | |
column ($title, $format, $sortable=false, $style=null, $typeHint=null, $onExport=null, $sortFormat=null) | |
Adds a column definition to the DataListView. More... | |
exportColumn ($title, $format, $sortable=false, $style=null, $typeHint=null, $onExport=null, $sortFormat=null) | |
Adds a column definition to the DataListView that is only output when exporting the table to Excel. More... | |
selector ($format="") | |
Adds a selector column to the DataListView. More... | |
formatRowId ($item) | |
footerText ($text="", $style="", $colspan=1) | |
Adds a text column to the table footer. More... | |
footerValue ($callback, $style="", $colspan=1) | |
Adds a value column to the table footer. More... | |
footerTotal ($field, $style="text-align: right", $colspan=1) | |
Sums the total for a column. More... | |
groupFooterText ($text="", $style="", $colspan=1) | |
Adds a text column to the table footer. More... | |
groupFooterTotal ($field, $style="text-align: right", $colspan=1) | |
setID ($id=null) | |
Sets the client-side ID for this DataListView. More... | |
autoPopulate ($item) | |
Automatically build the table columns from the given DataItem. More... | |
commandMenu () | |
Adds a ContextMenu to the table that can contain a list of operations that can be performed on subselections of the table's contents. More... | |
getExcelLink () | |
Get the Excel Link. More... | |
writeScript () | |
Write the Javascript to implement the table output. More... | |
drawView () | |
Writes the HTML for the data table to the output buffer. More... | |
drawViewToString () | |
Render the table view and return the generated HTML as a string. More... | |
getFooterColumnFormatting ($column) | |
drawSubFooterColumns () | |
writeExcelFile ($file) | |
Writes the data table out as an Excel File. More... | |
Public Attributes | |
$columns | |
The column definitions for the table. More... | |
$footerColumns | |
The footer column definitions for the table. More... | |
$cssClass | |
Optional CSS class to apply to the table. More... | |
$groupClass | |
The CSS class to apply to the group subheading rows. More... | |
$id | |
ID of the table in the output script. More... | |
$cssStyle | |
Optional additional inline styles to apply to the table. More... | |
$emptyMessage | |
Message to display when no items are present in the data set. More... | |
$onStartRow | |
Callback hook that gets called at the start of each row. More... | |
$onDrawFooter | |
Callback hook that gets called after all rows have been drawn. More... | |
$mode | |
The display mode for the table: fixed or tree. More... | |
$groups | |
The group definitions. More... | |
$items | |
The items to be displayed. More... | |
$excelFile | |
Name of the Excel file for automatic export to excel. More... | |
$summary | |
Human-readable summary of the information contained in the table (for usability/accessiblity purposes) More... | |
$selectable = false | |
Whether the table provides a selection mechanism. More... | |
$showSelectAll = true | |
Show Select All buttons for selectable tables. More... | |
$rowId = false | |
$rowIdFormat = null | |
Optionally specify a custom row ID format. More... | |
$groupFooterColumns = array() | |
$totalCallbacks = array() | |
$groupAsWorksheets = false | |
Format groups as separate worksheets when exporting to Excel (requires PHPExcel) More... | |
$menu = null | |
Context menu for selection-based operations. More... | |
$commandMenuIcon = "/fakoli/images/data_view_menu.png" | |
Icon to use for the command menu dropdown. More... | |
$hideExcelIcon = false | |
Suppress the automatic Excel icon if you want an external link. More... | |
$tagRowCallbacks = array() | |
Array of callbacks for adding extra attributes to each row. More... | |
$height | |
$scrollable = false | |
$resizable = true | |
GroupedDataListView displays a list of DataItems (or InnerJoinResults) in tabular format grouped by a specific field.
Grouped tables cannot be sortable or filterable by column or paginated. However, the groups can optionally be expandable by clicking, in either a "tree" or "accordion" style. With "tree" mode, each group can be expanded or hidden independently of the others. With "accordion" mode, only one group can be expanded at a time. With "fixed" mode, all the groups are displayed and cannot be hidden.
GroupedDataListViews can also be rendered directly into binary Microsoft Excel format via the writeExcelFile() method.
Definition at line 100 of file grouped_data_view.inc.
GroupedDataListView::addFacetTaggingHandler | ( | $handler | ) |
Adds a row tagging handler.
This function will receive the data item for each row and can add custom attributes to the row tag.
Definition at line 166 of file grouped_data_view.inc.
GroupedDataListView::autoGroup | ( | ) |
Definition at line 206 of file grouped_data_view.inc.
GroupedDataListView::autoPopulate | ( | $item | ) |
Automatically build the table columns from the given DataItem.
Not recommended except for quick and dirty pages. This method is called automatically if no columns have been defined before drawing the view.
$item | the item to use as a template for the columns. |
Definition at line 403 of file grouped_data_view.inc.
GroupedDataListView::column | ( | $title, | |
$format, | |||
$sortable = false , |
|||
$style = null , |
|||
$typeHint = null , |
|||
$onExport = null , |
|||
$sortFormat = null |
|||
) |
Adds a column definition to the DataListView.
$title | the title of the column | |
$format | the formatter for the column, either as a formatting string or callback function. (For details on format template specifications, see comments above class DataItem function format.) | |
$sortable | whether this column is sortable | |
$style | any inline styles specific to this column | |
$typeHint | hint for cell type to use when exporting to Excel | |
$onExport | optional callback function to format value for Excel | |
string | $sortFormat | Optional explicit format to use as the basis for sorting |
Definition at line 250 of file grouped_data_view.inc.
GroupedDataListView::commandMenu | ( | ) |
Adds a ContextMenu to the table that can contain a list of operations that can be performed on subselections of the table's contents.
Definition at line 421 of file grouped_data_view.inc.
GroupedDataListView::drawSubFooterColumns | ( | ) |
Definition at line 728 of file grouped_data_view.inc.
GroupedDataListView::drawView | ( | ) |
Writes the HTML for the data table to the output buffer.
Definition at line 485 of file grouped_data_view.inc.
GroupedDataListView::drawViewToString | ( | ) |
Render the table view and return the generated HTML as a string.
Definition at line 694 of file grouped_data_view.inc.
GroupedDataListView::exportColumn | ( | $title, | |
$format, | |||
$sortable = false , |
|||
$style = null , |
|||
$typeHint = null , |
|||
$onExport = null , |
|||
$sortFormat = null |
|||
) |
Adds a column definition to the DataListView that is only output when exporting the table to Excel.
Use this method for extended detail columns when space is constrained on the page but more details might be useful in an exported spreadsheet
$title | the title of the column | |
$format | the formatter for the column, either as a formatting string or callback function. (For details on format template specifications, see comments above class DataItem function format.) | |
$sortable | whether this column is sortable | |
$style | any inline styles specific to this column | |
$typeHint | hint for cell type to use when exporting to Excel | |
$onExport | optional callback function to format value for Excel | |
string | $sortFormat | Optional explicit format to use as the basis for sorting |
Definition at line 270 of file grouped_data_view.inc.
GroupedDataListView::footerText | ( | $text = "" , |
|
$style = "" , |
|||
$colspan = 1 |
|||
) |
Adds a text column to the table footer.
$text | string the text to display |
$style | string any CSS classes or inline styles to apply |
$colspan | int the colspan for the column |
Definition at line 323 of file grouped_data_view.inc.
GroupedDataListView::footerTotal | ( | $field, | |
$style = "text-align: right" , |
|||
$colspan = 1 |
|||
) |
Sums the total for a column.
$field | string the field to total in the format "{field}" |
$style | string any CSS classes or inline styles to apply |
$colspan | int the colspan for the column |
Definition at line 349 of file grouped_data_view.inc.
GroupedDataListView::footerValue | ( | $callback, | |
$style = "" , |
|||
$colspan = 1 |
|||
) |
Adds a value column to the table footer.
$callback | callable Callback function or object method used to calculate the value for this column. |
$style | string any CSS classes or inline styles to apply |
$colspan | int the colspan for the column |
Definition at line 336 of file grouped_data_view.inc.
GroupedDataListView::format | ( | $group, | |
$template | |||
) |
Outputs the text for the groupedBy title bar using the given group dataitem object.
This function should not be invoked directly, but is invoked as part of the GroupedDataListView's rendering operations.
$group | the dataitem object for the title bar being rendered |
Definition at line 223 of file grouped_data_view.inc.
GroupedDataListView::formatRowId | ( | $item | ) |
Definition at line 305 of file grouped_data_view.inc.
GroupedDataListView::getExcelLink | ( | ) |
Get the Excel Link.
Definition at line 433 of file grouped_data_view.inc.
GroupedDataListView::getFooterColumnFormatting | ( | $column | ) |
Definition at line 704 of file grouped_data_view.inc.
GroupedDataListView::getID | ( | ) |
Definition at line 157 of file grouped_data_view.inc.
GroupedDataListView::group | ( | $title, | |
$key, | |||
$expanded = false , |
|||
$fixed = false |
|||
) |
Adds a group to the view.
unknown_type | $title | the title text for the group. |
unknown_type | $key | the key value for the group. |
unknown_type | $expanded | true for expanded by default, false for collapsed by default |
Definition at line 178 of file grouped_data_view.inc.
GroupedDataListView::groupBy | ( | $groups, | |
$format = null , |
|||
$field = "" , |
|||
$expandedFn = null , |
|||
$fixedFn = null |
|||
) |
Add groups based on the supplied list of DataItems.
$groups | array list of DataItems |
$format | string format template for the group titles |
$field | string the field to use for the key (defaults to the primary key of the group items if not specified) |
$expandedFn | callable optional function that can be used to determine if each group should be expanded or collapsed |
$fixedFn | callable optional function that can be used to determine if each group should be fixed |
Definition at line 192 of file grouped_data_view.inc.
GroupedDataListView::GroupedDataListView | ( | $items, | |
$id, | |||
$cssClass = "list" , |
|||
$groupClass = "subheading" |
|||
) |
Creates a new GroupedDataListView object.
array | $items | the array of DataItems or InnerJoinResults to be displayed |
string | $id | the client-side ID for this table |
string | $cssClass | Optional CSS class to apply to the table |
string | $sortable | Specifies whether to enable client-side sorting for this table |
integer | $pageSize | Specifies the number of items per page - set to zero for unpaginated |
boolean | $filter | Specifies whether to enable client-side filtering for this table. |
Definition at line 143 of file grouped_data_view.inc.
GroupedDataListView::groupFooterText | ( | $text = "" , |
|
$style = "" , |
|||
$colspan = 1 |
|||
) |
Adds a text column to the table footer.
$text | the text to display |
$style | any CSS classes or inline styles to apply |
$colspan | the colspan for the column |
Definition at line 365 of file grouped_data_view.inc.
GroupedDataListView::groupFooterTotal | ( | $field, | |
$style = "text-align: right" , |
|||
$colspan = 1 |
|||
) |
Definition at line 372 of file grouped_data_view.inc.
GroupedDataListView::scrollable | ( | $height = 300 , |
|
$resizable = true |
|||
) |
Definition at line 231 of file grouped_data_view.inc.
GroupedDataListView::selector | ( | $format = "" | ) |
Adds a selector column to the DataListView.
If no format is specified then selection is handled via a checklist box for the list objects' primary keys.
$format | (optional) format to use for the selector |
Definition at line 283 of file grouped_data_view.inc.
GroupedDataListView::setID | ( | $id = null | ) |
Sets the client-side ID for this DataListView.
$id | the ID to use. Passing in null will generate a random ID string. |
Definition at line 386 of file grouped_data_view.inc.
GroupedDataListView::writeExcelFile | ( | $file | ) |
Writes the data table out as an Excel File.
The file is output with an 'attachment' disposition, which will prompt a save dialog in the client browser.
$file | the name of the file to be output. |
Definition at line 756 of file grouped_data_view.inc.
GroupedDataListView::writeScript | ( | ) |
Write the Javascript to implement the table output.
Definition at line 443 of file grouped_data_view.inc.
GroupedDataListView::$columns |
The column definitions for the table.
Definition at line 102 of file grouped_data_view.inc.
GroupedDataListView::$commandMenuIcon = "/fakoli/images/data_view_menu.png" |
Icon to use for the command menu dropdown.
Definition at line 124 of file grouped_data_view.inc.
GroupedDataListView::$cssClass |
Optional CSS class to apply to the table.
Definition at line 104 of file grouped_data_view.inc.
GroupedDataListView::$cssStyle |
Optional additional inline styles to apply to the table.
Definition at line 107 of file grouped_data_view.inc.
GroupedDataListView::$emptyMessage |
Message to display when no items are present in the data set.
Definition at line 108 of file grouped_data_view.inc.
GroupedDataListView::$excelFile |
Name of the Excel file for automatic export to excel.
Definition at line 114 of file grouped_data_view.inc.
GroupedDataListView::$footerColumns |
The footer column definitions for the table.
Definition at line 103 of file grouped_data_view.inc.
GroupedDataListView::$groupAsWorksheets = false |
Format groups as separate worksheets when exporting to Excel (requires PHPExcel)
Definition at line 122 of file grouped_data_view.inc.
GroupedDataListView::$groupClass |
The CSS class to apply to the group subheading rows.
Definition at line 105 of file grouped_data_view.inc.
GroupedDataListView::$groupFooterColumns = array() |
Definition at line 120 of file grouped_data_view.inc.
GroupedDataListView::$groups |
The group definitions.
Definition at line 112 of file grouped_data_view.inc.
GroupedDataListView::$height |
Definition at line 129 of file grouped_data_view.inc.
GroupedDataListView::$hideExcelIcon = false |
Suppress the automatic Excel icon if you want an external link.
Definition at line 125 of file grouped_data_view.inc.
GroupedDataListView::$id |
ID of the table in the output script.
Definition at line 106 of file grouped_data_view.inc.
GroupedDataListView::$items |
The items to be displayed.
Definition at line 113 of file grouped_data_view.inc.
GroupedDataListView::$menu = null |
Context menu for selection-based operations.
Definition at line 123 of file grouped_data_view.inc.
GroupedDataListView::$mode |
The display mode for the table: fixed or tree.
Definition at line 111 of file grouped_data_view.inc.
GroupedDataListView::$onDrawFooter |
Callback hook that gets called after all rows have been drawn.
Definition at line 110 of file grouped_data_view.inc.
GroupedDataListView::$onStartRow |
Callback hook that gets called at the start of each row.
Definition at line 109 of file grouped_data_view.inc.
GroupedDataListView::$resizable = true |
Definition at line 131 of file grouped_data_view.inc.
GroupedDataListView::$rowId = false |
Definition at line 118 of file grouped_data_view.inc.
GroupedDataListView::$rowIdFormat = null |
Optionally specify a custom row ID format.
Definition at line 119 of file grouped_data_view.inc.
GroupedDataListView::$scrollable = false |
Definition at line 130 of file grouped_data_view.inc.
GroupedDataListView::$selectable = false |
Whether the table provides a selection mechanism.
Definition at line 116 of file grouped_data_view.inc.
GroupedDataListView::$showSelectAll = true |
Show Select All buttons for selectable tables.
Definition at line 117 of file grouped_data_view.inc.
GroupedDataListView::$summary |
Human-readable summary of the information contained in the table (for usability/accessiblity purposes)
Definition at line 115 of file grouped_data_view.inc.
GroupedDataListView::$tagRowCallbacks = array() |
Array of callbacks for adding extra attributes to each row.
Definition at line 126 of file grouped_data_view.inc.
GroupedDataListView::$totalCallbacks = array() |
Definition at line 121 of file grouped_data_view.inc.