mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #1300 from patbolo/ticket/8328
FIX #8328 Expose previously selected values of TreeMultiSelectField so t...
This commit is contained in:
commit
3abfc7e25c
@ -115,13 +115,20 @@ class TreeMultiselectField extends TreeDropdownField {
|
|||||||
$title = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
$title = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dataUrlTree = '';
|
||||||
|
if ($this->form){
|
||||||
|
$dataUrlTree = $this->Link('tree');
|
||||||
|
if (isset($idArray) && count($idArray)){
|
||||||
|
$dataUrlTree .= '?forceValue='.implode(',',$idArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
return FormField::create_tag(
|
return FormField::create_tag(
|
||||||
'div',
|
'div',
|
||||||
array (
|
array (
|
||||||
'id' => "TreeDropdownField_{$this->id()}",
|
'id' => "TreeDropdownField_{$this->id()}",
|
||||||
'class' => 'TreeDropdownField multiple' . ($this->extraClass() ? " {$this->extraClass()}" : '')
|
'class' => 'TreeDropdownField multiple' . ($this->extraClass() ? " {$this->extraClass()}" : '')
|
||||||
. ($this->showSearch ? " searchable" : ''),
|
. ($this->showSearch ? " searchable" : ''),
|
||||||
'data-url-tree' => $this->form ? $this->Link('tree') : "",
|
'data-url-tree' => $dataUrlTree,
|
||||||
'data-title' => $title,
|
'data-title' => $title,
|
||||||
'title' => $this->getDescription()
|
'title' => $this->getDescription()
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user