- Home
- Forum
- React - EJ 2
- DropDownButton not rendered correctly in Toolbar
DropDownButton not rendered correctly in Toolbar
Hi,
I want to show a DropDownButton in a toolbar, however the button does not appear correctly, namely the text and the icon of the button are not visible.
I've attached a demo code that shows the problem.
Thanks.
Attachment: reactc816uj_55f05845.zip
Thanks for the reply.
However, this solution is not possible for me, since I'm adding the DropDownButton to the Scheduler Toolbar using the "actionBegin"-event.
See the following code snippet of my scheduler-actionBegin-event:
Sorry, should have specified that immediately in my opening forum question.
Any other solution?
|
onActionBegin(args) {
if (args.requestType === 'toolbarItemRendering') {
let toolbarDropDown = {
template: '<input type="text" id="dropDown" />',
type: 'Input',
};
args.items.push(toolbarDropDown);
}
}
onActionComplete(args) {
if (args.requestType === 'toolBarItemRendered') {
let toolbarDropDown = document.querySelector('#dropDown');
let dropdown = new DropDownList({
align: 'Left',
fields: { text: 'text', value: 'Id', iconCss: 'iconCss' },
dataSource: this.items,
placeholder: 'Select Item',
});
dropdown.appendTo(toolbarDropDown);
}
} |
Thanks for the quick reply, however I'm meeting the problem using a DropDownBUTTON.
I tried to modify the suggested solution using a DropDownButton, but it still does not work.
I change the provided solution to the following:
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
.
.
.
onActionBegin(args) {
if (args.requestType === 'toolbarItemRendering') {
let toolbarDropDown = {
template: '<button type="text" id="dropDown" />',
type: 'text',
};
args.items.push(toolbarDropDown);
}
}
onActionComplete(args) {
if (args.requestType === 'toolBarItemRendered') {
let toolbarDropDown = document.querySelector('#dropDown');
let dropdown = new DropDownButton({
content: 'Extras',
items: [
{
text: 'Item 1',
},
{
text: 'Item 2',
},
],
});
dropdown.appendTo(toolbarDropDown);
}
} |
- 5 Replies
- 3 Participants
-
LS Laurin S
- Sep 21, 2021 09:12 AM UTC
- Oct 13, 2021 10:40 AM UTC