I want to create a new custom control extend CartViewCustomControlBase in order to scan barcode as below. But It's very strange that the ts code cannot capture the click event of the button. Have anyone tried to do this case and give me some solutions? Thanks in advance.
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>ScanBarcode</title> <link href="ScanBarcodeControl.css" rel="stylesheet" /> </head> <body> <script id="CustomerAddEdit_Extension_ScanBarcode" type="text/html"> <div class="flexGrow75 flexRow row-enter" data-bind="visible:isVisible"> <button id="scanbarcode" type="button" class="scanbarcode flexGrow100 accentBackground" data-bind="click:scan"> <h1 class="primaryFontColor marginBottom0 scanlabelFont" data-bind="text:scanLabel"></h1> </button> </div> </script> </body> </html>
public scan():void { ... }