classname: htmlobject_tablebuilder
extends: htmlobject_table
Tablebuilder
@package htmlobjects
@author Alexander Kuballa [akuballa@users.sourceforge.net]
@copyright Copyright (c) 2008 - 2012, Alexander Kuballa
@license BSD License (see LICENSE.TXT)
@version 1.1
filename: htmlobject.tablebuilder.class.php
Attributes
Methods
Attributes
topattribute: actions
access: public
default:
topaccess: public
default:
array()
Actions row of table
@access public
@var array
$actions = array();
$actions[] = 'delete';
$actions[] = 'sort';
$table = new htmlobject_tablebuilder();
$table->actions = $actions;
attribute: actions_name
access: public
default:
topaccess: public
default:
empty
Name for submit actions @access public @var string
attribute: autosort
access: public
default:
topaccess: public
default:
false
Use array_sort if true, body will be sorted by tablebuilder @access public @var bol
attribute: body
access: public
default:
topaccess: public
default:
array()
Table body
@access public
@var array
$body = array();
$body[] = array('id' => 'value1', 'date' => 'value2', ...)
$body[] = array('id' => 'value1', 'date' => 'value2', ...)
$table = new htmlobject_tablebuilder();
$table->body = $body;
attribute: css_prefix
access: public
default:
topaccess: public
default:
htmlobject_
Global prefix for css classes @access public @var string
attribute: form_action
access: public
default:
topaccess: public
default:
empty
Url to process request no html form if empty @access public @var string
attribute: form_method
access: public
default:
topaccess: public
default:
POST
Form method @access public @var enum [GET|POST]
attribute: handler_tr
access: public
default:
topaccess: public
default:
array( 'onclick' => 'tr_click', 'onmouseover' => 'tr_hover', 'onmouseout' => 'tr_hover' )
Add handler and callback to trs
element and id of identifier will
be added to event callback function
@access array
@var string
$table->handler_tr = array('onclick' => 'tr_click');
<tr onclick="tr_click(this, 'id')">
attribute: head
access: public
default:
topaccess: public
default:
array()
Head row of table (th)
@access public
@var array
$head = array();
$head['id']['title'] = 'Id';
$head['date']['sortable'] = false;
$head['date']['hidden'] = true;
$head['date2']['title'] = 'Date';
$head['date2']['map'] = date;
$table = new htmlobject_tablebuilder();
$table->head = $head;
attribute: hide_empty
access: public
default:
topaccess: public
default:
false
Hide table when body is empty @access public @var bool
attribute: identifier
access: public
default:
topaccess: public
default:
empty
Field to add value to checkbox @access public @var string
attribute: identifier_checked
access: public
default:
topaccess: public
default:
array()
Array of identifiers to be checked @access public @var array
attribute: identifier_disabled
access: public
default:
topaccess: public
default:
array()
Array of identifiers to be disabled @access public @var array
attribute: identifier_name
access: public
default:
topaccess: public
default:
empty
Name of identifier input @access public @var string
attribute: identifier_type
access: public
default:
topaccess: public
default:
checkbox
Type of identifier input @access public @var enum [checkbox|radio]
attribute: limit
access: public
default:
topaccess: public
default:
20
Initial limit @access private @var int
attribute: limit_select
access: public
default:
topaccess: public
default:
array()
Select with limit values
@access public
@var array
$limit_select = array(
array("value" => 0, "text" => 'none'),
array("value" => 10, "text" => 10),
array("value" => 20, "text" => 20),
array("value" => 30, "text" => 30),
);
$table = new htmlobject_tablebuilder();
$table->limit_select = $limit_select;
attribute: max
access: public
default:
topaccess: public
default:
0
Maximum @access public @var int
attribute: offset
access: public
default:
topaccess: public
default:
0
Offset @access public @var int
attribute: order
access: public
default:
topaccess: public
default:
ASC
Sortorder @access public @var enum [ASC|DESC]
attribute: pageturn_bottom
access: public
default:
topaccess: public
default:
9
Pageturn Bottom @access public @var int
attribute: sort
access: public
default:
topaccess: public
default:
empty
Field to be sorted @access public @var string
attribute: sort_form
access: public
default:
topaccess: public
default:
true
Enable sortform @access public @var bool
attribute: sort_link
access: public
default:
access: public
default:
true
Enable sortlink in headrow @access public @var bool
Methods
topfunction: __construct
params:
topparams:
$html $id $params = null
Constructor @access public @param htmlobject $htmlobject @param string $id id for posted vars @param array|htmlobject_response $params array(key => value, ...);
function: init
topInit basic values __body and __cols @access public
function: get_object
topGet table as object @access public @return object
function: get_string
topGet table as string @access public @return string
function: add_headrow
params:
topparams:
$str = ''
Adds a row to top of table @access public @param string $str
function: add_bottomrow
params:
topparams:
$str = ''
Adds a row to bottom of table @access public @param string $str
function: get_js
topGet JS for tr hover and click function @access public @return string
function: get_params
topGet tablebuilder params @access public @return array
function: __get_head
topGet table head @access protected @return object|string htmlobject_tr or empty string
function: __get_body
topGet a row of table body @access protected @return object|array htmlobject_tr or empty array
function: __get_actions
topGet table actions row @access protected @return object|string htmlobject_tr or empty string
function: __get_sort
topGet sort functions form @access protected @return object|string
function: __get_params
topGet params inputs @access protected @return htmlobject_div
function: __get_lang
params:
topparams:
$param
Get single value from $this->html->lang['table'] @access protected @param string $param @return string
function: __get_pageturn
topGet page turn functions @access protected @return object
function: __get_select
topGet identifier multi select function @access protected @return string
function: __get_indentifier
params:
topparams:
$key $ident
Add identifier td to body row @access public @param int $key @param string $ident @return object|string
function: __get_js_tr
params:
topparams:
$ident
Get JS for tr @access public @param string $ident @return string
function: __sort
topSort array [body] by key [sort] @access protected
function: __request
params:
params:
$sort = '' $order = '' $limit = '' $offset = ''
Build params from request @access protected @param string $sort @param enum $order [ASC|DESC] @param string $limit @param string $offset
- htmlobject
- htmlobject_a
- htmlobject_base
- htmlobject_box
- htmlobject_button
- htmlobject_div
- htmlobject_form
- htmlobject_formbuilder
- htmlobject_iframe
- htmlobject_img
- htmlobject_input
- htmlobject_option
- htmlobject_request
- htmlobject_response
- htmlobject_select
- htmlobject_table
- htmlobject_tablebuilder
- htmlobject_tabmenu
- htmlobject_td
- htmlobject_template
- htmlobject_textarea
- htmlobject_tr