- Home
- Forum
- Angular - EJ 2
- Customize ribbon tabs
Customize ribbon tabs
I need to add custom ribbon tab and defined its' child components as in below screenshot.I have followed instruction in this page but couldn't proceed further. https://ej2.syncfusion.com/angular/documentation/api/spreadsheet/?_gl=1*1my432d*_ga*MTUxODQyOTI4NC4xNjMxNjA3Mjgx*_ga_WC4JKKPHH0*MTYzMjA1NjQxOC4yMC4xLjE2MzIwNTc1MTcuMA..&_ga=2.123655055.521482534.1632056421-1518429284.1631607281#addribbontabs
Could you please provide me an example which has following features.
- Add dropdown filed as a child to custom ribbon tab (i.e "Custome")
- Bind and event to above above dropdown field
|
this.spreadsheetObj.addRibbonTabs([
{
header: { text: 'Custom' }, // To add customized option with sub option
content: [
{
id: 'CustomButton',
tooltipText: 'CustomButton',
template: this.appendDropdownBtn('custombtn')
}
]
}
]);
public appendDropdownBtn(id: string): HTMLElement {
let ddlItems: ItemModel[] = [
{
text: 'Custom Text1'
},
{
text: 'Custom Text2'
}
];
let btnObj: DropDownButton = new DropDownButton({
items: ddlItems,
content: 'Custom',
select: (args: MenuEventArgs): void => {
alert(args.item.text + ' clicked');
}
});
btnObj.appendTo(createElement('button', { id: id }));
return btnObj.element;
} |
Hi Janakiraman,
Your sample helped me to resolve my problem. Thank you for your support.
I have new requirement that add a button with prefix icon to ribbon tab as in following example
I tried prefixIcon property without any success as below. Could you please help me to get this work and point me where I can find syncfusion icon repository?
|
let btnObj: DropDownButton = new DropDownButton({
items: ddlItems,
content: 'Custom',
iconCss:"ddb-icons e-search",
select: (args: MenuEventArgs): void => {
alert(args.item.text + ' clicked');
}
});
btnObj.appendTo(createElement('button', { className: 'e-icons', id: id }));
|
Thank you for the sample. However I am interesting on now is to add prefix icon (using prefixIcon) to button as in below screenshot.
We have checked your reported query and we would like to let you know that your requirement can be achievable by using the "iconCss" property of the DropDownButton. And you can position the icon before or on top of the text content in the DropDownButton by using the "iconPosition". For more details, please refer the below links:
- 5 Replies
- 2 Participants
-
RE Rahal Ekanayaka
- Sep 19, 2021 01:45 PM UTC
- Sep 27, 2021 12:42 PM UTC