NEW added value top options

This commit is contained in:
micmania1 2016-04-19 22:40:37 +00:00
parent 1e93da62d7
commit 2eb652f264
2 changed files with 10 additions and 3 deletions

View File

@ -40,7 +40,13 @@ class EditableMultipleOptionField extends EditableFormField {
'callback' => function($record, $column, $grid) { 'callback' => function($record, $column, $grid) {
return TextField::create($column); return TextField::create($column);
} }
), ),
'Value' => array(
'title' => _t('EditableMultipleOptionField.VALUE', 'Value'),
'callback' => function($record, $column, $grid) {
return TextField::create($column);
}
),
'Default' => array( 'Default' => array(
'title' => _t('EditableMultipleOptionField.DEFAULT', 'Selected by default?'), 'title' => _t('EditableMultipleOptionField.DEFAULT', 'Selected by default?'),
'callback' => function($record, $column, $grid) { 'callback' => function($record, $column, $grid) {
@ -171,7 +177,7 @@ class EditableMultipleOptionField extends EditableFormField {
*/ */
protected function getOptionsMap() { protected function getOptionsMap() {
$optionSet = $this->Options(); $optionSet = $this->Options();
$optionMap = $optionSet->map('EscapedTitle', 'Title'); $optionMap = $optionSet->map('Value', 'Title');
if($optionMap instanceof SS_Map) { if($optionMap instanceof SS_Map) {
return $optionMap->toArray(); return $optionMap->toArray();
} }

View File

@ -15,7 +15,8 @@ class EditableOption extends DataObject {
"Name" => "Varchar(255)", "Name" => "Varchar(255)",
"Title" => "Varchar(255)", "Title" => "Varchar(255)",
"Default" => "Boolean", "Default" => "Boolean",
"Sort" => "Int" "Sort" => "Int",
"Value" => "Varchar(255)",
); );
private static $has_one = array( private static $has_one = array(