import { Component, ViewChild, AfterViewInit, ViewEncapsulation, ElementRef } from '@angular/core'; import { jqxTabsComponent } from 'jqwidgets-ng/jqxtabs'; import { jqxListBoxComponent } from 'jqwidgets-ng/jqxlistbox'; import { jqxCheckBoxComponent } from 'jqwidgets-ng/jqxcheckbox'; @Component({ selector: 'app-root', styleUrls: ['./app.component.css'], templateUrl: './app.component.html', encapsulation: ViewEncapsulation.None }) export class AppComponent implements AfterViewInit { @ViewChild('jqxTabs', { static: false }) jqxTabs: jqxTabsComponent; @ViewChild('acceptCheckBox', { static: false }) acceptCheckBox: jqxCheckBoxComponent; @ViewChild('products', { static: false }) products: jqxListBoxComponent; @ViewChild('usernameInput', { static: false }) usernameInput: ElementRef; @ViewChild('passwordInput', { static: false }) passwordInput: ElementRef; @ViewChild('orderContainer', { static: false }) 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