PHP Class WPDKDynamicTableView

In addition you can drag & drop a single row to sort.
Since: 1.4.10
Author: =undo= ([email protected])
Inheritance: extends WPDKView
Datei anzeigen Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$sortable boolean Set TRUE for sortable rows

Public Methods

Method Description
__construct ( string $id ) : WPDKDynamicTableView Create an instance of WPDKDynamicTableView class
columns ( ) Return a key value pairs array with the column list
draw ( ) : string Return the HTML markup for dynamic table
items ( ) : array Retrun the items data to display

Private Methods

Method Description
_columns ( ) Return the columns list with internal column to add/remove a row tool
buttonAdd ( ) : string Return the HTML markup to display the add row button.
buttonDelete ( ) : string Return the HTML markup to display the delete row button.

Method Details

__construct() public method

Create an instance of WPDKDynamicTableView class
public __construct ( string $id ) : WPDKDynamicTableView
$id string ID for this dynamic table
return WPDKDynamicTableView

columns() public method

$columns = array( 'type' => array( '_label' => __( 'Type', WPXUSERSMANAGER_TEXTDOMAIN ), // Head label 'label' => __( 'Type', WPXUSERSMANAGER_TEXTDOMAIN ), 'type' => WPDKUIControlType::SELECT, 'name' => 'type[]', 'class' => 'wpxm_users_extra_field_type', 'title' => __( 'Select a field type', WPXUSERSMANAGER_TEXTDOMAIN ), 'data' => array( 'placement' => 'left' ), 'options' => $fields_type, 'value' => '', ), ... );
public columns ( )

draw() public method

Return the HTML markup for dynamic table
public draw ( ) : string
return string

items() public method

Retrun the items data to display
public items ( ) : array
return array

Property Details

$sortable public_oe property

Set TRUE for sortable rows
public bool $sortable
return boolean