import * as React from 'react'; import JqxCheckBox from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxcheckbox'; import JqxDropDownList, { IDropDownListProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxdropdownlist'; import JqxNumberInput from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxnumberinput'; import JqxRadioButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxradiobutton'; export interface IState extends IDropDownListProps { symbolTypes: IDropDownListProps['source']; decimalDigitsNumbers: IDropDownListProps['source']; digitsNumbers: IDropDownListProps['source']; } class App extends React.PureComponent<{}, IState> { private myNumberInput = React.createRef(); constructor(props: {}) { super(props); this.onChange = this.onChange.bind(this); this.checkedLeftButton = this.checkedLeftButton.bind(this); this.checkedRightButton = this.checkedRightButton.bind(this); this.symbolTypeSelect = this.symbolTypeSelect.bind(this); this.decimalDigitsSelect = this.decimalDigitsSelect.bind(this); this.digitsSelect = this.digitsSelect.bind(this); this.state = { decimalDigitsNumbers: ['0', '1', '2', '3', '4'], digitsNumbers: ['1', '2', '3', '4', '5', '6', '7', '8'], symbolTypes: ['$', '%', 'None'] } } public render() { return (
Show Spin Buttons
Symbol Position
Left
Right
Symbol
Decimal Digits
Digits
); } private onChange(event: any) { const checked = event.args.checked; this.myNumberInput.current!.setOptions({ spinButtons: checked }); }; private checkedLeftButton(event: any) { this.myNumberInput.current!.setOptions({ symbolPosition: 'left' }); }; private checkedRightButton(event: any) { this.myNumberInput.current!.setOptions({ symbolPosition: 'right' }); }; private symbolTypeSelect(event: any) { const index = event.args.index; if (index === 2) { this.myNumberInput.current!.setOptions({ symbol: '' }); } else { const symbol = this.state.symbolTypes![index]; this.myNumberInput.current!.setOptions({ symbol }); } }; private decimalDigitsSelect(event: any) { const index = event.args.index; this.myNumberInput.current!.setOptions({ decimalDigits: this.state.decimalDigitsNumbers![index] }); }; private digitsSelect(event: any) { const index = event.args.index; this.myNumberInput.current!.setOptions({ digits: this.state.digitsNumbers![index] }); }; } export default App;