Skip to content

Commit c23bf25

Browse files
author
Maxim Medinskiy
committed
MAGETWO-43648: CLONE - Multi-select customer attribute rendered in admin UI as a dropdown
1 parent d2611df commit c23bf25

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Ui\Component\Form\Element;
8+
9+
class MultiSelect extends Select
10+
{
11+
const NAME = 'multiselect';
12+
13+
const DEFAULT_SIZE = 6;
14+
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function prepare()
19+
{
20+
$config['size'] = self::DEFAULT_SIZE;
21+
$this->setData('config', array_replace_recursive((array)$this->getData('config'), $config));
22+
parent::prepare();
23+
}
24+
}

app/code/Magento/Ui/view/base/ui_component/etc/definition.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
</item>
200200
</argument>
201201
</select>
202-
<multiselect class="Magento\Ui\Component\Form\Element\Select">
202+
<multiselect class="Magento\Ui\Component\Form\Element\MultiSelect">
203203
<argument name="data" xsi:type="array">
204204
<item name="template" xsi:type="string">ui/form/element/multiselect</item>
205205
<item name="js_config" xsi:type="array">
@@ -209,6 +209,9 @@
209209
<item name="elementTmpl" xsi:type="string">ui/form/element/multiselect</item>
210210
</item>
211211
</item>
212+
<item name="config" xsi:type="array">
213+
<item name="size" xsi:type="string">6</item>
214+
</item>
212215
</argument>
213216
</multiselect>
214217
<textarea class="Magento\Ui\Component\Form\Element\Textarea">

0 commit comments

Comments
 (0)