BoldDesk®Customer service software with ticketing, live chat & omnichannel support, starting at $99/mo for unlimited agents. Try for free!
Hi Team!
I have created a ribbon use the ejs-ribbon control as below image
I make a button in the my application, when I click this button, I want to hide a tab or group in the Ribbon control
Do you have any property for the Ribbon to hide this one?
Please let me know your solution or suggestion to resolve this one
Thanks!
Hi Pham,
Greetings from Syncfusion support,
You can use the built-in methods showTab, hideTab, showGroup & hideGroup to dynamically show or hide tabs and groups in the Ribbon control based on your requirements. Please check the below shared code block and sample for reference.
Sample - link
App.component.html
<div id="default-ribbonContainer"> <label for="checked" style="padding: 10px">Show / hide "Insert" tab: </label> <ejs-switch onLabel="ON" offLabel="OFF" (change)='onTabSwitch($event)'></ejs-switch> <label for="checked" style="padding: 10px">Show / hide "Illustrations" group of "Insert" tab: </label> <ejs-switch onLabel="ON" offLabel="OFF" (change)='onGroupSwitch($event)'></ejs-switch> <ejs-ribbon #defaultRibbon id="default-ribbon" [fileMenu]='fileSettings' [enablePersistence]="true" (launcherIconClick)='launchClick($event)'> <e-ribbon-tabs> <e-ribbon-tab header="Home"> <e-ribbon-groups> .... <e-ribbon-group header="Illustrations" overflowHeader="Illustrations" id="defaultRibbon-insert-illustration" [showLauncherIcon]=true orientation="Row" groupIconCss="e-icons e-image" [enableGroupOverflow]=true> <e-ribbon-collections> ..... </e-ribbon-groups> </e-ribbon-tab> </e-ribbon-tabs> </ejs-ribbon> </div> |
App.component.ts
public pasteOptions: ItemModel[] = [{ text: "Keep Source Format" }, { text: "Merge Format" }, { text: "Keep Text Only" }]; public pasteSettings: RibbonSplitButtonSettingsModel = { iconCss: 'e-icons e-paste', items: this.pasteOptions, content: 'Paste' }; .... public onTabSwitch(args) { if (args.checked) this.ribbonObj.hideTab('defaultRibbon-insert'); else this.ribbonObj.showTab('defaultRibbon-insert'); }
public onGroupSwitch(args) { if (args.checked) this.ribbonObj.hideGroup('defaultRibbon-insert-illustration'); else this.ribbonObj.showGroup('defaultRibbon-insert-illustration'); } |
Please get back to us if you need any further assistance.
Regards,
Vigneshwaran
Thanks
Vigneshwaran
I have tried it and it's working fine
Thank You!
Pham,
Welcome, please get back to us if you need any further assistance.
Regards,
Indrajith
Hi
Indrajith Srinivasan
I have tried your solution in the sample code
I can hide the Tab of the Ribbon Component but I cannot hide the Group
this is my code, as you can see, I want to hidden the Clipboard group, I used the hideGroup method but it's not working
Please let me know your suggestion in this case?
Thank You!
SY
Hi Pham,
Good day to you,
We have checked your shared code blocks and tried to replicate the reported issue with the ribbon component, but the methods showGroup & hideGroup works fine. Check the below shared sample for your reference.
Sample - Link
if (args.checked){ this.ribbonObj.hideTab('defaultRibbon-equation'); this.ribbonObj.hideGroup('defaultRibbon-home-clipboard'); } else { this.ribbonObj.showTab('defaultRibbon-equation'); this.ribbonObj.showGroup('defaultRibbon-home-clipboard'); } }
|
Can you please share with us the following details?
The above details will be helpful for us to further validate the reported issue and assist you better.
Regards,
Indrajith
Thank for your reply
Here is my source code for ribbon style, please help me to find any anomalies in the above code
Thank You!
SY
Pham,
Thank you for sharing your ribbon style code. We have tried to replicate the reported issue with the already shared sample, but still the functionality of methods works fine. Shared the ensured sample for your reference.
Sample - Link
In addition, we have reviewed the provided styles, and Deep Styling (::ng-deep) is a suspect that could impact the syncfusion styles:
If you still encounter similar issues, to proceed further can you please share with us the following details
Looking forward to your response.
Regards,
Indrajith
Thank Indrajith Srinivasan,
As describe in the video below, I want to hide the Speak Logic Group and the Equations Tab by select an option to hide
In the first time, the group and tab was hidden but when I changed the domain, the Speak Logic still appear on the ribbon
Here is video and my source code, please review it and let me know how to hide this group
Video
Code
Thank You!
Pham,
Sorry for the delay in getting back to you.
On further validation with the reported issue using the shared samples, we have identified that the Speak Logic group reappears due to the component re-rendering triggered when interacting with items in the Domain tab. During this re-render, the Syncfusion Ribbon component resets to its initial state, and previously hidden groups (like Speak Logic) become visible again.
To resolve this, we introduced a Boolean flag isGroupHide to manage the visibility state of the Speak Logic group. We used a slight delay inside ngOnInit to apply the hideGroup or showGroup method calls after Angular completes its re-render cycle. Please check the below shared code block for reference.
sync-ribbon.component.ts
private isGroupHide: boolean = false;
ngOnInit() { this.coreService.getDomain().pipe(takeUntil(this._destroyed)).subscribe((domain) => { … setTimeout(() => { if (this.isGroupHide) { this.ribbonObj.hideGroup('defaultRibbon-insert-speaklogic'); } else { this.ribbonObj.showGroup('defaultRibbon-insert-speaklogic'); } }, 50); }); …… }
private handleShowOrHideEquationTab(applicationSetting: ApplicationSettingOptions) { ….. if (applicationSetting === ApplicationSettingOptions.NonMath) { this.isGroupHide = true; ….. } else { this.isGroupHide = false; ….. } } |
Please let us know if you need any further assistance on this.
Regards,
Indrajith
Thank Indrajith Srinivasan,
I have tried and it's working fine
Thank You!
SY