![]() |
Framework
3.9
|
Displays a control that provides a highly styleable set of options from which the user can select a number of items. More...
Public Member Functions | |
OptionCrossReferenceFieldRenderer (&$form, $field, $label, $options, $nameField, $xrefClass, $grouped=false) | |
groupBy ($groupBy, $format="") | |
renderScript ($field) | |
FieldRenderers can override this method to provide any Javascript that their control requires for an edit form. More... | |
renderField ($field) | |
FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field. More... | |
renderOptions ($field, $options, $selectedItems) | |
renderReadOnly ($field) | |
getSelected ($obj, $rc, $pk) | |
getMatchingPK ($xref, $obj) | |
postProcess ($field="") | |
FieldRenderers can override this method to provide behavior that occurs after the parent form's target object has been saved to the database. More... | |
clearOutRelations ($obj, $pk, $tx) | |
Clear out the current relations stored in the xref class. More... | |
![]() | |
FieldRenderer ($parent) | |
Constructor. More... | |
_printLabel ($field, $colspan=1, $styles="", $annotation="") | |
Internal method to generate the HTML for the field label. More... | |
_getLabel ($field, $addSuffix=true) | |
_startField ($field, $styles="") | |
Internal method to generate the starting HTML for the field (including the label) More... | |
_endField ($field) | |
Internal method to generate the closing HTML for the field. More... | |
addValidatorsToForm ($field, $required=false) | |
This method is called by the AutoForm to add any default input validators that are required by the FieldRenderer. More... | |
addSearchValidatorsToForm ($field, $mode, $required=false) | |
For SearchForm, the validator field needs to match the name tag in the form which is in the format field:mode. More... | |
formatName ($item, $name) | |
Formats the given DataItem based on the supplied format string. More... | |
renderSearchScript ($field, $mode) | |
FieldRenderers can override this method to provide any Javascript that the control requires when being used in a search form. More... | |
renderSearchField ($field, $mode) | |
FieldRenderers must override this method to provide the HTML implementation of the control displayed for the field in a search form. More... | |
renderOnSubmitHandler ($field) | |
FieldRenderers can override this method to provide any Javascript that must be executed when the form is submitted on the client. More... | |
preProcess ($field="") | |
FieldRenderers can override this method to provide behavior that occurs prior to the saving of the parent form's target object to the database. More... | |
Public Attributes | |
$options = array() | |
$cssClass = "options_list" | |
$separator = ", " | |
$nameField | |
$xrefClass | |
$onStartOption = null | |
$grouped = false | |
$groupTag = "h4" | |
$containerClass = "" | |
![]() | |
$parent = null | |
$labelSuffix = "" | |
$colspan = 1 | |
$annotateBefore = false | |
$annotateNextLine = true | |
$hideLabel = false | |
$onPreProcess = null | |
callback hook for processing prior to saving the form's data object - individual renderers may override with custom processing More... | |
$onPostProcess = null | |
callback hook for processing after saving the form's data object - individual renderers may override with custom processing More... | |
Displays a control that provides a highly styleable set of options from which the user can select a number of items.
The options are provided as an array of DataItems that are associated with the target item of the form via a cross-reference table that contains foreign keys to both. The options are rendered as an unordered list in HTML, with javascript to provide the selection interaction. Clicking on one of the items will select the associated value. The currently selected list item is given the "selected" CSS class.
Options can be grouped by three distinct mechanisms. Firstly, the array of items passed in can be an associative array with the group headings as the keys. Secondly the options can be automatically grouped by the values in a specified field by calling the groupBy() method with the name of the field and a formatting string for the group heading. Finally the options can be grouped by a secondary list of DataItems by passing an array to the groupBy() method. In this case the options will be grouped by the primary key values of the supplied objects, and must contain a matching foreign key.
Definition at line 21 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::clearOutRelations | ( | $obj, | |
$pk, | |||
$tx | |||
) |
Clear out the current relations stored in the xref class.
Object | $obj | |
String | $pk |
Definition at line 311 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::getMatchingPK | ( | $xref, | |
$obj | |||
) |
Definition at line 245 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::getSelected | ( | $obj, | |
$rc, | |||
$pk | |||
) |
Definition at line 240 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::groupBy | ( | $groupBy, | |
$format = "" |
|||
) |
Definition at line 53 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::OptionCrossReferenceFieldRenderer | ( | & | $form, |
$field, | |||
$label, | |||
$options, | |||
$nameField, | |||
$xrefClass, | |||
$grouped = false |
|||
) |
Definition at line 33 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::postProcess | ( | $field = "" | ) |
FieldRenderers can override this method to provide behavior that occurs after the parent form's target object has been saved to the database.
For example, the CrossReferenceSelectFieldRenderer overrides this method to update crossference tables based on the user's selection.
string | $field |
Reimplemented from FieldRenderer.
Definition at line 256 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::renderField | ( | $field | ) |
FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field.
string | $field | the field name |
Reimplemented from FieldRenderer.
Definition at line 100 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::renderOptions | ( | $field, | |
$options, | |||
$selectedItems | |||
) |
Definition at line 187 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::renderReadOnly | ( | $field | ) |
Definition at line 213 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::renderScript | ( | $field | ) |
FieldRenderers can override this method to provide any Javascript that their control requires for an edit form.
string | $field | the field name |
Reimplemented from FieldRenderer.
Definition at line 59 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$containerClass = "" |
Definition at line 31 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$cssClass = "options_list" |
Definition at line 24 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$grouped = false |
Definition at line 29 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$groupTag = "h4" |
Definition at line 30 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$nameField |
Definition at line 26 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$onStartOption = null |
Definition at line 28 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$options = array() |
Definition at line 23 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$separator = ", " |
Definition at line 25 of file option_cross_reference_field_renderer.inc.
OptionCrossReferenceFieldRenderer::$xrefClass |
Definition at line 27 of file option_cross_reference_field_renderer.inc.