|
<ejs-tab id="element" #element [showCloseButton]="true" (selected)="select($event)" (created)=created($event) >
<e-tabitems>
<e-tabitem [header]='headerText[0]' content="#idv"></e-tabitem>
<e-tabitem [header]='headerText[1]' cssClass="withoutIcon" content="#idv" ></e-tabitem> //set the cssClass property for tab item to show without close icon
</e-tabitems>
</ejs-tab>
Ts:
public created(e){
this.tabObj.items.push({ header: { text: 'DynamicTabItem' }, cssClass:"withoutIcon", content: "#idv" });
//use the same way for dynamically created tab also
(<any>this.tabObj).refresh();
}
CSS:
.e-tab .e-tab-header .e-toolbar-item.withoutIcon span.e-icons.e-close-icon { //using the custom cssClass class for tab item, disable the close icon
display: none;
}
|
Hello,
I have the same requirement, and for some reason, using the markup [ngClass] in e-tabitem doesnt seem to work. Any idea why and how I could make it work?
Here is an extract of my code:
<ejs-tab id="tab_default" #tabObj [animation]="animation"
[showCloseButton]="selectedAnalysisVersion?.analysisVersionId === latestAnalysisVersionId"
(removing)="onDeleteSection($event)">
<e-tabitems>
<ng-container formArrayName="sections">
<ng-container *ngFor="let sectionControl of sections?.controls; let i = index">
<e-tabitem *ngIf="sectionControl.value.analysisSectionType === AnalysisSectionType.Default"
[ngClass]="{ withoutIcon: sectionControl.value.isMandatory }">
<!-- the value sectionControl.value.isMandatory is correct and contains either True or False but the class is never applied -->
<p>{{ sectionControl.value.sectionName }}</p>
<ng-template #headerText>
<div>{{ sectionControl.value.sectionName }}-{{ sectionControl.value.isMandatory }}g</div>
</ng-template>
<ng-template #content>
Thanks & Regards,
Yvan
got this fixed by using directly the cssClass property as follow:
cssClass="{{ sectionControl.value.isMandatory ? 'withoutIcon' : '' }}"
thanks!
Hi Yvan,
We are happy that you have found the solution yourself.
Regards,
Satheesh Kumar B