I have two tab controls each sitting within its own panel of an ejs-layout. I need their selected lines to be yellow. I can’t get them both to convert. The left one will, the right one will not. BUT
If I remove the left one, the right one does render yellow. See attached screen shots.
Left Tab html:
<div id="Panel3" class="e-panel" data-row="3" data-col="0" data-sizeX="4" data-sizeY="5" style="border-radius:1em;"
>
<div class="e-panel-container">
<ejs-tab #managerTeamTab id="tab_default" style="float:left; text-align: left;"(created)="onCreated($event)" >
<div class="e-tab-header" headerStyle="e-background">
Right Tab html:
<div id="Panel4" class="e-panel" data-row="3" data-col="5" data-sizeX="2" data-sizeY="5" style="border-radius:1em;"
>
<div class="e-panel-container">
<ejs-tab #managerSourceTab id="managerSourceTab" style="float:left;"(created)="onTabCreated($event)" >
<div class="e-tab-header" headerStyle="e-background">
.scss
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text {
color: var(--reqDarkBlue) !important;
//you will notice both tab controls have blue text
}
#tab_default .e-tab-header .e-toolbar-items .e-indicator.custom {
background: var(--reqYellow) !important;
/*selected tab line*/
}
#managerSourceTab .e-tab-header .e-toolbar-items .e-indicator.custom {
background: var(--reqYellow) !important;
}
.ts
The onCreated are the same. I’d split them out during troubleshooting
onCreated(args: any): void {
const myDocument = document.querySelector(".e-indicator");
if (myDocument ===null){
console.log('element is null');
} else {
myDocument.classList.add("custom");
}
}
onTabCreated(args: any): void {
const myDocument = document.querySelector(".e-indicator");
if (myDocument ===null){
console.log('element is null');
} else {
myDocument.classList.add("custom");
}
}
Notice when both present, the right one stays red. If I remove the left one, the right one turns yellow. Therefore, the references work.
How do I get them both yellow?
Thanks.
Hi Walter,
Greetings from Syncfusion support.
You can set the tab indicator color by simply overwriting the Tab default CSS class like the below.
.e-tab-header
.e-toolbar-items
.e-indicator {
background: yellow
!important;
}
Kindly try the above solution and let us know if this meets your requirement.
Regards,
Ruksar Moosa Sait
You solution does work for one and per the screenshots, I can indeed set one tab control's color.
The problem is it won't do two tab controls.
First one is yellow, second is default red.
If I remove the first one, the second will turn yellow.
app.component.ts:
onCreated(args: any): void { const myDocument = document.querySelector( '#tab_default .e-tab-header .e-toolbar-items .e-indicator' ); if (myDocument === null) { console.log('element is null'); } else { myDocument.classList.add('custom'); } } onTabCreated(args: any): void { const myDocument = document.querySelector( '#managerSourceTab .e-tab-header .e-toolbar-items .e-indicator' ); if (myDocument === null) { console.log('element is null'); } else { myDocument.classList.add('custom'); } } |
It sure does. I certainly appreciate the assist.
Hi Walter,
Thanks for the update.
We are happy that our solution helped to achieve your requirement.
Regards,
Ravikumar Venkatesan