import { Component, ViewChild, AfterViewInit, ViewEncapsulation, ElementRef } from '@angular/core'; import { jqxTabsComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtabs'; import { jqxListBoxComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxlistbox'; import { jqxCheckBoxComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxcheckbox'; @Component({ selector: 'app-root', styleUrls: ['./app.component.css'], templateUrl: './app.component.html', encapsulation: ViewEncapsulation.None }) export class AppComponent implements AfterViewInit { @ViewChild('jqxTabs') jqxTabs: jqxTabsComponent; @ViewChild('acceptCheckBox') acceptCheckBox: jqxCheckBoxComponent; @ViewChild('products') products: jqxListBoxComponent; @ViewChild('usernameInput') usernameInput: ElementRef; @ViewChild('passwordInput') passwordInput: ElementRef; @ViewChild('orderContainer') orderContainer: ElementRef; getWidth() : any { if (document.body.offsetWidth < 500) { return '90%'; } return 500; } ngAfterViewInit() { this.validate(true); this._addHandlers(); } _addHandlers = () => { this.usernameInput.nativeElement.addEventListener('keyup', () => { this.validate(true); }); this.usernameInput.nativeElement.addEventListener('change', () => { this.validate(true); }); this.passwordInput.nativeElement.addEventListener('keyup', () => { this.validate(true); }); let nextButtonClass = document.getElementsByClassName('nextButton'); for (let i = 0; i < nextButtonClass.length; i++) { let currentNextButton = nextButtonClass[i]; currentNextButton.addEventListener('click', () => { this.validate(true); this.jqxTabs.next(); }); } let backButtonClass = document.getElementsByClassName('backButton'); for (let i = 0; i < backButtonClass.length; i++) { let currentBackButton = backButtonClass[i]; currentBackButton.addEventListener('click', () => { this.validate(true); this.jqxTabs.previous(); }); } }; acceptCheckBoxChange(event: any): void { this.validate(true); }; productsChange(event: any): void { this.validate(true); let selectedItems = this.products.selectedIndexes(), count = selectedItems.length; let parent = this.orderContainer.nativeElement; while (parent.firstChild) { parent.removeChild(parent.firstChild); } while (count) { count--; if (typeof selectedItems[count] !== 'undefined' && selectedItems[count] !== -1) { let currentHtmlContent = parent.innerHTML; parent.innerHTML = currentHtmlContent + '
jqxNumberInput
jqxProgressBar
jqxCalendar
jqxButton
jqxDropDownList
jqxListBox
jqxTooltip