|
|
|
@@ -1,4 +1,4 @@ |
|
|
|
import React, { lazy, useState } from 'react'; |
|
|
|
import React, { lazy, useRef, useState } from 'react'; |
|
|
|
import { |
|
|
|
CBadge, |
|
|
|
CButton, |
|
|
|
@@ -22,18 +22,13 @@ const WidgetsDropdown = lazy(() => import('../widgets/WidgetsDropdown.js')) |
|
|
|
const DemoComponent5 = () => { |
|
|
|
|
|
|
|
const [rowNum, setRowNum] = useState(0); |
|
|
|
const [inputValue, setInputValue] = useState(""); |
|
|
|
|
|
|
|
const handleChange = (event) => { |
|
|
|
if (!isNaN(event.target.value)) { |
|
|
|
setRowNum(event.target.value); |
|
|
|
setInputValue(event.target.value); |
|
|
|
} else { |
|
|
|
alert('Not a number'); |
|
|
|
setInputValue(""); |
|
|
|
} |
|
|
|
const refInput = useRef(); |
|
|
|
const handleSubmit = (event) => |
|
|
|
{ |
|
|
|
setRowNum(event.target.value); |
|
|
|
exec(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const exec = () => { |
|
|
|
PDFEngine(); |
|
|
|
window.print(); |
|
|
|
@@ -46,8 +41,10 @@ const DemoComponent5 = () => { |
|
|
|
<h4>PDFEngine</h4> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', flexDirection: 'row', marginLeft: '10px' }}> |
|
|
|
<input value={inputValue} style={{ border: '.5px solid lightGray', outline: 'none', backgroundColor: '#f2f2f2', borderRadius: '5px' }} placeholder=" Enter row number" type="text" name="name" onChange={handleChange} /> |
|
|
|
<button style={{ marginLeft: '5px' }} className=" btn btn-primary" onClick={exec}>Remove</button> |
|
|
|
<form onSubmit={handleSubmit}> |
|
|
|
<input ref={refInput} style={{ border: '.5px solid lightGray', outline: 'none', backgroundColor: '#f2f2f2', borderRadius: '5px' }} placeholder=" Enter row number" type="text" name="name" /> |
|
|
|
<button style={{ marginLeft: '5px' }} className=" btn btn-primary">Remove</button> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |