mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2270 from ARNHOE/3.1-updatedfieldgroup
BUG Updated fieldgroup class and example code
This commit is contained in:
commit
770e23f8e1
@ -1007,7 +1007,7 @@ jQuery.noConflict();
|
||||
* we can fix the height cropping.
|
||||
*/
|
||||
|
||||
$('.cms .field.dropdown select, .cms .field select[multiple]').entwine({
|
||||
$('.cms .field.dropdown select, .cms .field select[multiple], .fieldholder-small select.dropdown').entwine({
|
||||
onmatch: function() {
|
||||
if(this.is('.no-chzn')) {
|
||||
this._super();
|
||||
|
@ -9,14 +9,14 @@
|
||||
* <b>Usage</b>
|
||||
*
|
||||
* <code>
|
||||
* new FieldGroup(
|
||||
* new FieldGroup(
|
||||
* new HeaderField('FieldGroup 1'),
|
||||
* new TextField('Firstname')
|
||||
* FieldGroup::create(
|
||||
* FieldGroup::create(
|
||||
* HeaderField::create('FieldGroup 1'),
|
||||
* TextField::create('Firstname')
|
||||
* ),
|
||||
* new FieldGroup(
|
||||
* new HeaderField('FieldGroup 2'),
|
||||
* new TextField('Surname')
|
||||
* FieldGroup::create(
|
||||
* HeaderField::create('FieldGroup 2'),
|
||||
* TextField::create('Surname')
|
||||
* )
|
||||
* )
|
||||
* </code>
|
||||
@ -28,10 +28,10 @@
|
||||
* $fields = parent::getCMSFields();
|
||||
*
|
||||
* $fields->addFieldToTab(
|
||||
* 'Root.Content',
|
||||
* new FieldGroup(
|
||||
* new TimeField("StartTime","What's the start time?"),
|
||||
* new TimeField("EndTime","What's the end time?")
|
||||
* 'Root.Main',
|
||||
* FieldGroup::create(
|
||||
* TimeField::create("StartTime","What's the start time?"),
|
||||
* TimeField::create("EndTime","What's the end time?")
|
||||
* ),
|
||||
* 'Content'
|
||||
* );
|
||||
@ -40,6 +40,17 @@
|
||||
*
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* <b>Setting a title to a FieldGroup</b>
|
||||
*
|
||||
* <code>
|
||||
* $fields->addFieldToTab("Root.Main",
|
||||
* FieldGroup::create(
|
||||
* TimeField::create('StartTime','What's the start time?'),
|
||||
* TimeField::create('EndTime', 'What's the end time?')
|
||||
* )->setTitle('Time')
|
||||
* );
|
||||
* </code>
|
||||
*
|
||||
* @package forms
|
||||
* @subpackage fields-structural
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div <% if $Name %>id="$Name"<% end_if %> class="field $Type $extraClass">
|
||||
<div <% if $Name %>id="$Name"<% end_if %> class="field $Type">
|
||||
<% if $Title %><label class="left">$Title</label><% end_if %>
|
||||
|
||||
<div class="middleColumn fieldgroup <% if Zebra %>fieldgroup-$Zebra<% end_if %>">
|
||||
<div class="middleColumn fieldgroup<% if $Zebra %> fieldgroup-$Zebra<% end_if %>">
|
||||
<% loop $FieldList %>
|
||||
<div class="fieldgroup-field $FirstLast $EvenOdd">
|
||||
$SmallFieldHolder
|
||||
|
Loading…
Reference in New Issue
Block a user