import { Component, ViewChild, ElementRef } from '@angular/core'; import { jqxToolBarComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtoolbar'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { @ViewChild('myToolbar') myToolBar: jqxToolBarComponent; @ViewChild('shape') shape: ElementRef; getWidth() : any { if (document.body.offsetWidth < 700) { return '90%'; } return 700; } theme: string = ''; tools: string = 'input | input | dropdownlist | custom'; initTools: any = (type: any, index: number, tool: any, menuToolIninitialization: any): void => { switch (index) { case 0: tool.jqxInput({ width: 130, placeHolder: 'Enter width...' }); tool.on('change', () => { this.shape.nativeElement.style.width = tool.val() + 'px'; }); break; case 1: tool.jqxInput({ width: 130, placeHolder: 'Enter height...' }); tool.on('change', () => { this.shape.nativeElement.style.height = tool.val() + 'px'; }); break; case 2: tool.jqxDropDownList({ width: 130, source: ['square', 'circle'] }); tool.on('change', (event) => { let args = event.args; if (args) { let label = args.item.label; if (label == 'square') { this.shape.nativeElement.style.borderRadius = 0; } else { this.shape.nativeElement.style.borderRadius = '50%'; } } }); break; case 3: tool.append("