<ejs-tab id="MyElement" overflowMode="Scrollable"
scrollStep="200" contentLoad="init" #MyElement>
<e-tabitems>
<e-tabitem class="tab-container
tabbable-line" [header]="{{'FiscalCountry' | localize}}">
<div class="form-group">
<label for="Surname" *ngIf="useName()">{{"Surname"
| localize}} *</label>
<label for="Surname"
*ngIf="!useName()">{{"BusinessName" | localize}}
*</label>
<input id="Surname" #surnameInput="ngModel"
type="text" name="Surname" [(ngModel)]="item.surname" required maxlength="250">
<validation-messages
[formCtrl]="surnameInput"></validation-messages>
</div>
</e-tabitem>
</e-tabitems>
</ejs-tab>
|
<ejs-dialog #template [animationSettings]="animationSettings" [showCloseIcon]="showCloseIcon" [height]="height"
[target]="target" [width]="width">
<ng-template #content>
<div class="dialogContent">
<ejs-tab id="adaptiveTab" #adaptiveTab>
<e-tabitems>
<ng-template ngFor let-data [ngForOf]="datas" let-i="index">
<e-tabitem [header]="data.FiscalCountry | localize">
<ng-template #content>
<div *ngIf="data.Surname == 'Surname - 1'">
Name <input type="text">
Surname<input type="text">
Country<input type="text">
Telephone number<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 2'">
Notes 2<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 3'">
Notes 3<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 4'">
Notes 4<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 5'">
Notes 5<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 6'">
Notes 6<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 7'">
Notes 7<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 8'">
Notes 8<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 9'">
Notes 9<input type="text">
</div>
<div *ngIf="data.Surname == 'Surname - 10'">
Notes 10<input type="text">
</div>
</ng-template>
</e-tabitem>
</ng-template>
</e-tabitems>
</ejs-tab>
</div>
</ng-template>
<ng-template #header>
<div id="dlg-template" title="Tab" class="e-icon-settings">Tab</div>
</ng-template>
</ejs-dialog> |
|
export class AppComponent {
constructor() { }
@ViewChild("template") public Dialog: DialogComponent;
@ViewChild("ButtonInstance") public dlgbtn: ButtonComponent;
@ViewChild("adaptiveTab") public tabObj: TabComponent;
public showCloseIcon: Boolean = true;
public target = ".control-section";
public animationSettings: AnimationSettingsModel = { effect: "None" };
public height = "60%";
public width = "60%";
public datas = [
{ FiscalCountry: { text: "Country - 1" }, Surname: "Surname - 1", Businessname: "Businessname - 1" },
{ FiscalCountry: { text: "Country - 2" }, Surname: "Surname - 2", Businessname: "Businessname - 2" },
{ FiscalCountry: { text: "Country - 3" }, Surname: "Surname - 3", Businessname: "Businessname - 3" }
];
public BtnClick = (): void => {
this.Dialog.show();
}
public localize = true;
} |
|
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: "localize"
})
export class LocalizePipe implements PipeTransform {
transform(value: any, isLocalize: boolean = true): any {
if (value === "") {
return { text: "" };
}
if (isLocalize) {
return { text: "Localized " + value.text };
}
return { text: value.text };
}
} |
|
export class AppComponent implements AfterViewChecked {
constructor() {}
ngAfterViewChecked() {
if (this.tabObj) {
setTimeout(function() {
(document.querySelector("#adaptiveTab .e-toolbar") as any).ej2_instances[0].refreshOverflow();
}, 40);
}
}
} |