\recordEditTableField

Defines a recordEditTable field, allowing to display a list of records from another table inside a form field. recordEditTable and recordSelectField allow to create a one to may relationship.

Unlike the recordSelect field, the recordEditTable field retains no value in the current record, it only displays a view on a list of records matching the SQL query defined for this field. It specifically has the advantage of providing all of the showRecordEditable() function features, such as showing a finely configured table of records, with it values interpreted using keyprocessors.

Summary

Methods
Properties
Constants
displayField()
onSave()
getCSS()
getTopJS()
getBottomJS()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

displayField()

displayField(  $f) 

Returns the HTML code for displaying the field, initialized with the data supplied in $fieldData

Creates a select box populated with records from other tables. Records can be edited, deleted, copied, pasted in the same field or an other field displaying the same type of records. Records can be created too. All these features can be enabled / disabled by configurable options. VERY IMPORTANT : the added record (a dbRecord extended class) MUST feature a column/field named parent_uid of type int(11), which is required for the copy paste operations. This column will/must contain the uid of the parent record where the current field is displayed as an option in a select field.

Parameters

$f

fieldData : this stdClass object contains all the field info. Defining the function arguments into an object avoids redefining all existing functions already issued when a new argument requires to be added to the calls. $f->formID // value of the id attribute of the

tag this field is included in $f->mode // the mode value allows discriminating between templates (mode=="template|") and microtemplates (mode=="micro|") $f->dataType // this is an numeric array of every arguments included in the 'dataType' index of the field. example : $MyField['dataType']='input text' gets available as array(0 => 'input', 1=> 'text') $f->key // this is the unique key (or field name/identifier ) for the currentField. Exemple : 'clientName' $f->fieldData // this is the data array of the current field $f->recordUid // the uid (Unique ID) of the record containing the current field $f->recordClassName // the class name of the record containing the current field $f->record // all the data for the record containing the current field $f->microKey // field name when processing a microTemplate field (only used when mode=="micro|") $f->microIndex // sorting index when processing a microTemplate field (only used when mode=="micro|")

onSave()

onSave(  $fieldData,   $value) : mixed

Process the field value prior saving it to the database, whenever inner value adaptation is required, for SQL strict compliance for example.

This is executed after 'preRecord' processing functions.

Parameters

$fieldData

this is the data array of the current field

$value

this is the submited value

Returns

mixed

getCSS()

getCSS() 

Returns the HTML code necessary to add the CSS files required by this field

getTopJS()

getTopJS() 

Returns the HTML code necessary to add at the top of the HTML page the JS files or scripts required by this field

getBottomJS()

getBottomJS() 

Returns the HTML code necessary to add at the bottom of the HTML page the JS files or scripts required by this field