MarkupAdminDataTable class
Module that provides an API for rendering of HTML tables in the ProcessWire admin (or elsewhere)
This module provides a consistent way for rendering <table> elements in the ProcessWire admin. It can certainly be used outside of the admin as well, but it gets its default classes from those
defined by the admin theme. For example, if your system uses AdminThemeUikit then this module
will use uk-table classes.
$table = $modules->get('MarkupAdminDataTable');
$table->setSortable(true);
$table->headerRow([ 'First name', 'Last name', 'Email' ]);
foreach($people as $person) {
$table->row([ $person->first_name, $person->last_name, $person->email ]);
}
echo $table->render(); This module populates Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Set the footer row for the table Set the header row for the table Render the table Add a row to the table (see arguments for details) Set table caption Set a column as not sortable (first column is 0) Set whether or not entity encoding is enabled Set whether or not table is resizable Set the responsive mode of this table Set whether or not table is sortable Add a class to the <table> without replacing existing ones Remove a class from the <table> Set class(es) to add to <table> Set table id attribute In addition to the methods and properties above, Markup$config->styles and $config->scripts with its MarkupAdminDatable.css and MarkupMarkup class also inherits all the methods and properties of: ModuleJS, WireData and Wire.Content
Name Return Summary self
Can also be used as property: $table->footerRow self
Can also be used as property: $table->headerRow stringself None Settings
Name Return Summary None None None None None Attributes
Name Return Summary None None None None Properties
Name Return Summary $table->actions array Action buttons for under the table $table->border int Table border attribute $table->caption string Content for table <caption> tag. $table->class string Class attribute for <table> element $table->encodeEntities bool Should table content be entity encoded? Set to false if already encoded. $table->id string HTML id attribute for table $table->resizable bool Should table be resizable? $table->responsive bool Use responsive mode? 0=off, 1=responsive, 2=responsive stack $table->rowAttrs array Attributes for table rows indexed by row number (0 is first) $table->rowClasses array Classes for table rows indexed by row number (0 is first) $table->rows array Table rows $table->settings array Array of table settings $table->sortable bool Should table be sortable? Additional methods and properties
API reference based on ProcessWire core version 3.0.255