phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
DataElement Class Reference

DataElement widget for displaying an instance of model. More...

+ Inheritance diagram for DataElement:
+ Collaboration diagram for DataElement:

Public Member Functions

 __construct ($identifier, $modelInstance=NULL)
 
 compile (JsUtils $js=NULL, &$view=NULL)
 
 getFieldValue ($index)
 
 getHtmlComponent ()
 
 onNewRow ($callback)
 The callback function called after the insertion of each row when fromDatabaseObjects is called callback function takes the parameters $row : the row inserted and $object: the instance of model used. More...
 
 asForm ()
 
 setColCaptionWidth ($width)
 
 setColValueWidth ($width)
 
 setColWidths ($widths)
 
 run (JsUtils $js)
 
- Public Member Functions inherited from Widget
 __construct ($identifier, $model, $modelInstance=NULL)
 
 show ($modelInstance)
 
 getModel ()
 
 setModel ($_model)
 
 getInstanceViewer ()
 
 setInstanceViewer ($_instanceViewer)
 
 getHtmlComponent ()
 
 setAttached ($value=true)
 
 afterCompile ($index, $callback)
 Associates a $callback function after the compilation of the field at $index position The $callback function can take the following arguments : $field=>the compiled field, $instance : the active instance of the object, $index: the field position. More...
 
 setColor ($color)
 
 setCaptions ($captions)
 
 setCaption ($index, $caption)
 
 setFields ($fields)
 
 addField ($field, $key=null)
 
 addFields ($fields)
 
 countFields ()
 
 addMessage ($attributes=NULL, $fieldName="message")
 
 addErrorMessage ()
 
 insertField ($index, $field, $key=null)
 
 insertInField ($index, $field, $key=null)
 
 setValueFunction ($index, $callback)
 Defines the function which displays the field value. More...
 
 setIdentifierFunction ($callback)
 
 getToolbar ()
 
 addInToolbar ($element, $callback=NULL)
 Adds a new element in toolbar. More...
 
 addItemInToolbar ($caption, $icon=NULL, $callback=NULL)
 
 addItemsInToolbar (array $items, $callback=NULL)
 
 addDropdownInToolbar ($value, $items, $callback=NULL)
 
 addButtonInToolbar ($caption, $cssStyle=null, $callback=NULL)
 
 addButtonsInToolbar (array $captions, $asIcon=false, $callback=NULL)
 
 addLabelledIconButtonInToolbar ($caption, $icon, $before=true, $labeled=false)
 
 addSubmitInToolbar ($identifier, $value, $cssStyle=NULL, $url=NULL, $responseElement=NULL, $parameters=NULL)
 
 setCaptionCallback ($captionCallback)
 Defines a callback function to call for modifying captions function parameters 0are. More...
 
 setEdition ($_edition=true)
 Makes the input fields editable. More...
 
 setDefaultValueFunction ($defaultValueFunction)
 Defines the default function which displays fields value. More...
 
 getDefaultValueFunction ()
 
 jsDisabled ($disable=true)
 
 addEditButtonInToolbar ($caption, $callback=NULL)
 
 setToolbar (HtmlMenu $_toolbar)
 
 setToolbarPosition ($_toolbarPosition)
 
 getForm ()
 
 run (JsUtils $js)
 
 setValidationParams (array $_validationParams)
 Sets the parameters for the Form validation (on, inline, delay...) More...
 
 moveFieldTo ($from, $to)
 
 swapFields ($index1, $index2)
 
 removeField ($index)
 
 asModal ($header=null)
 
 addToProperty ($name, $value, $separator=" ")
 
 getModelInstance ()
 
 hasRules ()
 
- Public Member Functions inherited from HtmlDoubleElement
 __construct ($identifier, $tagName="p")
 
 setContent ($content)
 
 getContent ()
 
 addContent ($content, $before=false)
 
 run (JsUtils $js)
 
 setValue ($value)
 
 wrapContent ($before, $after="")
 
 wrapWith (HtmlDoubleElement $container)
 Wraps the element with a container. More...
 
 getContentInstances ($class)
 
 asLink ($href=NULL, $target=NULL)
 Transforms the element into a link. More...
 
 getTextContent ()
 
 asEditable (HtmlFormField $field, $asForm=false, $setValueProperty="val()")
 
- Public Member Functions inherited from HtmlSingleElement
 __construct ($identifier, $tagName="br")
 
 setClass ($classNames)
 
 addClass ($classNames)
 
 setRole ($value)
 
 setTitle ($value)
 
 setStyle ($value)
 
 run (JsUtils $js)
 
 fromArray ($array)
 
 setSize ($size)
 
- Public Member Functions inherited from BaseHtml
 run (JsUtils $js)
 
 getTagName ()
 
 setTagName ($tagName)
 
 fromArray ($array)
 
 fromDatabaseObjects ($objects, $function)
 
 fromDatabaseObject ($object, $function)
 
 wrap ($before, $after="")
 
 getElementById ($identifier, $elements)
 
 getBsComponent ()
 
 setBsComponent ($bsComponent)
 
 compile (JsUtils $js=NULL, &$view=NULL)
 
 setDraggable ($attr="id", $dropZone=null, $parameters=[])
 Sets the element draggable, and eventualy defines the dropzone (HTML5 drag and drop) More...
 
 asDropZone ($jsCallback="", $jqueryDone="append", $parameters=[])
 Declares the element as a drop zone (HTML5 drag and drop) More...
 
 asFileDropZone ($responseElement=null, $url=null, $progress=null, $jsCallback="", $parameters=[])
 Declares the element as a drop zone for file uploading (HTML5 drag and drop) More...
 
 __toString ()
 
 onPostCompile ($callback)
 
 onPreCompile ($callback)
 
- Public Member Functions inherited from BaseWidget
 __construct ($identifier)
 
 getIdentifier ()
 
 setIdentifier ($identifier)
 
 getLibraryId ()
 
 setLibraryId ($_libraryId)
 

Protected Member Functions

 _generateContent ($table)
 
 _applyStyleAttributes (HtmlTable $table)
 
 _getFieldName ($index)
 
 _getFieldCaption ($index)
 
 _getFieldIdentifier ($prefix, $name="")
 
 _setToolbarPosition ($table, $captions=NULL)
 {} More...
 
- Protected Member Functions inherited from Widget
 _init ($instanceViewer, $contentKey, $content, $edition)
 
 _getIndex ($fieldName)
 
 _getFieldIdentifier ($prefix, $name="")
 
 _getFieldName ($index)
 
 _getFieldCaption ($index)
 
 _setToolbarPosition ($table, $captions=NULL)
 
 runForm (JsUtils $js)
 
 _compileForm ()
 
- Protected Member Functions inherited from HtmlDoubleElement
 _getContentInstances ($class, $content)
 
 compile_once (\Ajax\JsUtils $js=NULL, &$view=NULL)
 {} More...
 
- Protected Member Functions inherited from BaseHtml
 getTemplate (JsUtils $js=NULL, $view=null)
 
 ctrl ($name, $value, $typeCtrl)
 
 setMemberCtrl (&$name, $value, $typeCtrl)
 
 addToMemberUnique (&$name, $value, $typeCtrl, $separator=" ")
 
 addToMemberCtrl (&$name, $value, $typeCtrl, $separator=" ")
 
 addToMember (&$name, $value, $separator=' ')
 
 removeOldValues (&$oldValue, $allValues)
 
 _getElementBy ($callback, $elements)
 
 setWrapBefore ($wrapBefore)
 
 setWrapAfter ($wrapAfter)
 
 compile_once (JsUtils $js=NULL, &$view=NULL)
 
- Protected Member Functions inherited from BaseWidget
 cleanIdentifier ($id)
 

Protected Attributes

 $_colWidths
 
- Protected Attributes inherited from Widget
 $_model
 
 $_modelInstance
 
 $_instanceViewer
 
 $_toolbar
 
 $_toolbarPosition
 
 $_edition
 
 $_form
 
 $_generated
 
 $_runned
 
 $_hasRules
 
- Protected Attributes inherited from HtmlDoubleElement
 $content
 
 $wrapContentBefore = ""
 
 $wrapContentAfter = ""
 
 $_editableContent
 
- Protected Attributes inherited from BaseHtml
 $_template
 
 $tagName
 
 $_wrapBefore = array()
 
 $_wrapAfter = array()
 
 $_bsComponent
 
 $_compiled = false
 
 $_runned = false
 
 $_postCompile
 
 $_preCompile
 
- Protected Attributes inherited from BaseWidget
 $identifier
 
 $_identifier
 
 $_libraryId
 
 $_self
 

Detailed Description

DataElement widget for displaying an instance of model.

Version
1.0
Author
jc
Since
2.2

Definition at line 20 of file DataElement.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $identifier,
  $modelInstance = NULL 
)

Definition at line 24 of file DataElement.php.

Member Function Documentation

◆ _applyStyleAttributes()

_applyStyleAttributes ( HtmlTable  $table)
protected

Definition at line 79 of file DataElement.php.

◆ _generateContent()

_generateContent (   $table)
protected
Parameters
HtmlTable$table

Definition at line 53 of file DataElement.php.

◆ _getFieldCaption()

_getFieldCaption (   $index)
protected

Definition at line 86 of file DataElement.php.

◆ _getFieldIdentifier()

_getFieldIdentifier (   $prefix,
  $name = "" 
)
protected

Definition at line 90 of file DataElement.php.

◆ _getFieldName()

_getFieldName (   $index)
protected

Definition at line 82 of file DataElement.php.

◆ _setToolbarPosition()

_setToolbarPosition (   $table,
  $captions = NULL 
)
protected

{}

See also
::_setToolbarPosition()

Definition at line 107 of file DataElement.php.

◆ asForm()

asForm ( )

Definition at line 122 of file DataElement.php.

◆ compile()

compile ( JsUtils  $js = NULL,
$view = NULL 
)

Definition at line 30 of file DataElement.php.

◆ getFieldValue()

getFieldValue (   $index)

Definition at line 65 of file DataElement.php.

◆ getHtmlComponent()

getHtmlComponent ( )

See also
::getHtmlComponent()
Returns
HtmlTable

Definition at line 99 of file DataElement.php.

◆ onNewRow()

onNewRow (   $callback)

The callback function called after the insertion of each row when fromDatabaseObjects is called callback function takes the parameters $row : the row inserted and $object: the instance of model used.

Parameters
callable$callback
Returns
DataElement

Definition at line 117 of file DataElement.php.

◆ run()

run ( JsUtils  $js)

Definition at line 141 of file DataElement.php.

◆ setColCaptionWidth()

setColCaptionWidth (   $width)

Definition at line 126 of file DataElement.php.

◆ setColValueWidth()

setColValueWidth (   $width)

Definition at line 131 of file DataElement.php.

◆ setColWidths()

setColWidths (   $widths)

Definition at line 136 of file DataElement.php.

Field Documentation

◆ $_colWidths

$_colWidths
protected

Definition at line 22 of file DataElement.php.


The documentation for this class was generated from the following file: