Class DataTable
Data table class for generate table with header, footer, data list, bulk actions, pagination.
This class is copied from the WordPress list table class.
public
|
|
public
|
#
__destruct( )
DataTable class de-constructor. |
protected
string
|
|
protected
string
|
#
columnDefault( object $row, string $column_unique_name )
Column default. |
public
|
|
protected
array
|
|
protected
array
|
#
getColumnClasses( object $row, string $column_unique_name = '' )
Get column classes. th or td in the tbody . |
protected
array
|
#
getColumnFooterClasses( string $column_unique_name = '' )
Get column footer classes. th or td in the tfoot . |
protected
array
|
#
getColumnHeaderClasses( string $column_unique_name = '' )
Get column header classes. th or td in the thead . |
protected
array
|
|
protected
integer
|
|
protected
string
|
#
getPrimaryColumn( )
Get primary column from unique name. |
protected
array
|
#
getRowActions( object $row, string $column_unique_name, string $primary_column_name )
Get row actions. |
protected
array
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
#
getTbodyTrTdNodataAttributes( )
Get tbody tr td attributes where it has no data (including class but do not including colspan). |
protected
string
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
|
protected
array
|
|
public
|
|
protected
|
#
preparePagination( )
Prepare pagination. Any customizable of pagination can override by this method. |
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
#
printExtraTableControls( string $which )
Print extra table controls next to bulk actions but before pagination. |
protected
|
#
printPagination( string $which )
Print pagination. |
protected
|
|
protected
|
#
printRowsOrPlaceholder( )
Display table rows inside tbody or no items place holder if there is no item found. |
protected
|
|
protected
|
|
protected
|
#
printTableControls( string $which = 'top' )
Print table controls such as bulk actions, pagination or also know as table nav in WordPress. |
protected
string
|
#
renderAttributes( array $attributes = [] )
Render attributes from get***Attributes() methods. (Not echo out just render as string.) |
protected
|
#
renderRowActions( object $row, string $column_unique_name, string $primary_column_name )
Render row actions. |
public
|
protected
integer
|
$columnsCount
Columns count. |
#
0
|
protected
|
$Database
The database class connector. |
|
protected
array
|
$dataItems
Store data items fetched from database. |
#
[]
|
protected
integer
|
$itemsPerPage
Number of items to display per page. |
#
20
|
protected
string
|
$orderQueryName
The order query string name. Its value is column name in the db table. Override this if you have many data table in a page. |
#
'order'
|
protected
Rundiz\Pagination\Pagination
|
$Pagination
The pagination class connector. |
|
protected
string
|
$paginationQueryName
Pagination query string name. Example: pagination query string like this (?paged=3) the pagination query string name is "paged". You can change this value in case that you have many data table in a page. |
#
'paged'
|
protected
boolean
|
$showFooterColumn
Show footer column or not. (By default it is set to false means not show.) |
#
true
|
protected
string
|
$sortQueryName
The sort query string name. Its value basically is ASC, or DESC. Override this if you have many data table in a page. |
#
'sort'
|
protected
mixed
|
$tempProperties
Temporary default properties for restore their values when call reset() method. |
|
protected
integer
|
$totalItems
Total items count from database. |
#
0
|