ScanButton (Barcode/NFC)
This form control (button) starts a scan of barcodes and processes the decoded information inside the form. The control is based on the NPM cross-platform barcode scanner for cordova and ZXing barcode scanner for browser.
<div id="scanBtn"
class="pdf-hide"
data-win-control="HFWinJSCtrl.ScanButton"
data-win-options="{
buttonType: 'large',
icon: 'fa-barcode-scan',
buttonHeading: 'QR-Code',
buttonLabel: 'Scan',
scan: {
fieldId: 'add_parts_item1',
scanType: 'BARCODE',
config: {
preferFrontCamera : false,
showFlipCameraButton : true,
showTorchButton : true,
saveHistory: false,
prompt : 'Please scan the appropriate barcode...',
resultDisplayDuration: 500,
formats : 'QR_CODE,AZTEC',
disableAnimations : true,
disableSuccessBeep: false
},
audioFeedback: true,
vibrationFeedback: true,
callbackFeedback: true,
callback: HFFormdefinition.BaseHelpers.customQRScanButton
}
}">
</div>
<div id="nfcScanBtn" class="hide-in-view"
data-win-control="HFWinJSCtrl.ScanButton"
data-win-options="{
buttonType: 'large',
buttonHeading: 'NFC-Code',
buttonLabel: 'Scan',
buttonIcon: 'fa-times',
scan: {
mapping: {
'0': 'nfc-textfield-1',
'1': 'nfc-textfield-2',
'2': 'nfc-textfield-3'
},
scanType: 'NFC',
postProcess: HFFormdefinition.BaseHelpers.postProcessNFC
}
}">
</div>
FormControl Options
buttonType - required
Define the size of the button ('small', 'medium' or 'large').
How to use:
buttonType: 'large'
Type:
'small' | 'medium' | 'large'
fieldId - required
Provide the ID of the form control receiving the scanned value.
How to use:
fieldId: 'add_parts_item1'
Type:
string
buttonHeading
Define a label for the control element.
How to use:
buttonHeading: 'Navigation'
Type:
string