Actions
open-scanner
4min
this action is used to scan a qr code the open scanner can be used in a list of actions, such as the swipe action and the right element, or with another action where the open scanner action is invoked after the main action is performed, opening access to the camera configuration options an open scanner action can be set up in various ways as a separate action or in the action list docid\ c214apgfspkq gkyzryo7 as a swipeable action in the left or right direction as a rightelement in the list as an associated action in the action list examples and code snippets open scanner action this is an example of using the open scanner as a stand alone action in this case, the button appears at the bottom, and when pressed, it accesses the camera and allows us to scan the qr code examples see the full example in github open scanner action jigx children \ type component form options children \ type component text field instanceid qr value options label "qr response" initialvalue =@ctx components scanner action state value actions \ children \ type action open scanner instanceid scanner action options title "scan qr code" modal title scan complete onsuccess type action go back open scanner swipeable left/right this example uses the open scanner action as a swipeable property we can choose the swipe direction left or right after pressing the button, it accesses the camera and allows us to scan the qr code examples see the full example in github open scanner swipeable jigx data =@ctx datasources employees static item type component list item options title =@ctx current item lastname subtitle =@ctx current item firstname leftelement element avatar text " " uri =@ctx current item img swipeable left \ label scan qr code onpress type action open scanner instanceid scanner swipeable left options modal title scan complete onsuccess type action go back right \ label scan qr code onpress type action open scanner instanceid scanner swipeable right options modal title scan complete onsuccess type action go back open scanner rightelement in this example, we use the open scanner action as the rightelement in the list item component there is a button for each item examples see the full example in github open scanner rightelement jigx data =@ctx datasources employees static item type component list item options title =@ctx current item lastname subtitle =@ctx current item firstname leftelement element avatar text " " uri =@ctx current item img rightelement element button title scan qr code onpress type action open scanner instanceid scanner rightelement options modal title scan complete onsuccess type action go back open scanner onsuccess in this example, the open scanner action is associated with the submit form action after we enter the signature and press the "sign" button, the submit form action is performed and the action for open scanner is shown access to the camera is not shown automatically you have to click on "scan qr code" examples see the full example in github open scanner onsuccess jigx actions \ children \ type action action list options title sign and proceed with the payment issequential true actions \ type action execute entity options provider data provider dynamic entity default/form method create data signature =@ctx components signature state value onsuccess title succesfully signed description please scan the product code to proceed with the payment actions \ type action open scanner instanceid scanner onsuccess options title scan qr code modal title scan complete onsuccess type action go back \ type action go back children \ type component form instanceid send signature scan options isdiscardchangesalertenabled false children \ type component signature field instanceid signature options label signature required