import * as React from 'react'; import './App.css'; import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons'; import JqxComplexInput, { IComplexInputProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxcomplexinput'; import JqxDropDownList, { IDropDownListProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxdropdownlist'; import JqxExpander from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxexpander'; export interface IState extends IComplexInputProps { selectedIndex: IDropDownListProps['selectedIndex']; source: IDropDownListProps['source']; } class App extends React.PureComponent<{}, IState> { private myComplexInput = React.createRef(); constructor(props: {}) { super(props); this.notationsListOnChange = this.notationsListOnChange.bind(this); this.getRealDecimalOnClick = this.getRealDecimalOnClick.bind(this); this.getRealExponentialOnClick = this.getRealExponentialOnClick.bind(this); this.getRealScientificOnClick = this.getRealScientificOnClick.bind(this); this.getRealEngineeringOnClick = this.getRealEngineeringOnClick.bind(this); this.getImaginaryDecimalOnClick = this.getImaginaryDecimalOnClick.bind(this); this.getImaginaryExponentialOnClick = this.getImaginaryExponentialOnClick.bind(this); this.getImaginaryScientificOnClick = this.getImaginaryScientificOnClick.bind(this); this.getImaginaryEngineeringOnClick = this.getImaginaryEngineeringOnClick.bind(this); this.state = { decimalNotation: 'exponential', selectedIndex: 1, source: ['decimal', 'exponential', 'scientific', 'engineering'] }; } public render() { return (
Angular ComplexInput Notation Settings

Choose notation:

Real part

Get Decimal Value Get Exponential Notation

Get Scientific Notation Get Engineering Notation

Imaginary part

Get Decimal Value Get Exponential Notation

Get Scientific Notation Get Engineering Notation
); } private notationsListOnChange(event: any): void { const args = event.args; if (args) { const index = args.index; let label = args.item.label; if (label === 'decimal') { label = 'default'; } this.setState({ decimalNotation: label, selectedIndex: index }); } }; private getRealDecimalOnClick(): void { const decimalValue = this.myComplexInput.current!.getReal(); alert('Decimal value: ' + decimalValue); }; private getRealExponentialOnClick(): void { const exponentialValue = this.myComplexInput.current!.getDecimalNotation('real', 'exponential'); alert('Exponential notation: ' + exponentialValue); }; private getRealScientificOnClick(): void { const scientificValue = this.myComplexInput.current!.getDecimalNotation('real', 'scientific'); alert('Scientific notation: ' + scientificValue); }; private getRealEngineeringOnClick(): void { const engineeringValue = this.myComplexInput.current!.getDecimalNotation('real', 'engineering'); alert('Engineering notation: ' + engineeringValue); }; private getImaginaryDecimalOnClick(): void { const decimalValue = this.myComplexInput.current!.getImaginary(); alert('Decimal value: ' + decimalValue); }; private getImaginaryExponentialOnClick(): void { const exponentialValue = this.myComplexInput.current!.getDecimalNotation('imaginary', 'exponential'); alert('Exponential notation: ' + exponentialValue); }; private getImaginaryScientificOnClick(): void { const scientificValue = this.myComplexInput.current!.getDecimalNotation('imaginary', 'scientific'); alert('Scientific notation: ' + scientificValue); }; private getImaginaryEngineeringOnClick(): void { const engineeringValue = this.myComplexInput.current!.getDecimalNotation('imaginary', 'engineering'); alert('Engineering notation: ' + engineeringValue); }; } export default App;