User Tools

Site Tools


field_class

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
field_class [2021/03/17 16:29] sahlfield_class [2022/05/23 10:41] (current) – [HTML composition of form fields] sahl
Line 70: Line 70:
 </code> </code>
  
 +==== Width and sizes ====
 +
 +The field (which is considered both the field and the label will obtain 100 % of the available width).
 +
 +The field itself can be one of three sizes.
 +
 +A normal size field will be 280 px wide.
 +A small size field will be 120 px wide.
 +A tiny size field will be 50 px wide.
 +
 +This can be overwritten by the field-width parameter. If there isn't enough free space the field will scale down.
 +
 +The label will always be 130 px wide and if the label exceeds that amount it will appear over several lines. This can be overwritten by the label-width parameter.
 +The label will always have a 0 px padding before the text and a 5 px padding after the text.
 ===== Form fields ===== ===== Form fields =====
  
Line 86: Line 100:
 This provides a combobox field which is a field that allow any value, but will suggest values as the user starts typing. This field uses Jquery autocomplete and takes an option named ''datasource'' which should be compatible with the ''source'' field of Jquery autocomplete. This provides a combobox field which is a field that allow any value, but will suggest values as the user starts typing. This field uses Jquery autocomplete and takes an option named ''datasource'' which should be compatible with the ''source'' field of Jquery autocomplete.
  
 +==== FieldComponent ====
 +
 +This field allows to add [[Component Class|Components]] as form fields. Please refer to [[FieldComponent Class]] for using this feature.
 ==== FieldDatarecordCombobox ==== ==== FieldDatarecordCombobox ====
  
Line 237: Line 254:
 Furthermore the value intended as the real output from the form should be saved in the ''$this->value'' variable. For simple fields this could just be a copy of ''$value'' but for more sofisticated fields, this value maybe needs postprocessing. Furthermore the value intended as the real output from the form should be saved in the ''$this->value'' variable. For simple fields this could just be a copy of ''$value'' but for more sofisticated fields, this value maybe needs postprocessing.
  
 +==== Using script ====
 +
 +If the field requires javascript, this can be included using ''Page::JSfile($file)''. It should be wrapped in the ''addCustomPlatformFunction'' such as:
 +
 +<code javascript customcomponent.js>
 +addCustomPlatformFunction(function(item) {
 +  $('.mycomponent', item).dosomething...
 +}
 +</code>
 ==== Other services of the Field class ==== ==== Other services of the Field class ====
  
field_class.1615998543.txt.gz · Last modified: 2021/03/17 16:29 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki