Hi,
I would like to use a MultiSelectComponent as a toolbar item in the ToolbarComponent. Using the template property of the ItemModel I'm able to visualize the MultiSelectComponent, however, when I'm selecting an element of the MultiSelect, I'm having the following problems:
I've attached a demo piece of code, that shows the two problems. Thanks.
<MultiSelectComponent
allowFiltering={true} width="400px" dataSource={[ { id: '1', description: 'Item 1' }, { id: '2', description: 'Item 2' }, { id: '3', description: 'Item 3' } ]} fields={this.fields} mode="Box" placeholder="Mode BOX" showSelectAll={true} showClearButton={true} showDropDownIcon={true} filterBarPlaceholder="Select" /> |
import {
CheckBoxSelection, Inject, MultiSelectComponent } from '@syncfusion/ej2-react-dropdowns'; <MultiSelectComponent>
<Inject services={[CheckBoxSelection]} /> </MultiSelectComponent> |
Thanks for the quick replay.
Query 1: To sum up, there is no way to have an automatic adjustment of the width, correct?
Query 2: How can I use the "<Inject services={...} />" when using the "items" property of the toolbar, and therefore using the MultiSelect class, instead of the MultiSelectComponent? (as used in the original code example)
I have to use the items-property of the toolbar, since I have to create the items dynamically. Therefore, I have to use the MultiSelect-class, rather than the MultiSelectComponent, since the "template" property of a toolbar item allows me only to use objects...
Can you please add the "needed" code lines in the attached code sample to make the demo work, without changing the general structure and property assignments. Thanks.
import {
CheckBoxSelection, MultiSelect } from '@syncfusion/ej2-react-dropdowns'; MultiSelect.Inject(CheckBoxSelection); |