Actions
set-active-tab
6 min
programmatically set the next active tab to display in the jig tabs docid\ published dsfpdovrld5oetm pzcfv the action determines which tab will open next for example, if you are on the third tab, the action button can be set to open the first tab configuration options some properties are common to all components, see common component properties docid\ llntd rxe8fmh7wpc5czb for a list and their configuration options core structure action identifier give the action a unique name that will be used to reference the action in another jig's action see the example below id provide the jigid for the jig that will be opened next state configuration key notes =@ctx jig state initialtabid a state variable used to reference the tab designated as the default =@ctx jig state activetabid a state variable that references the currently active tab considerations the action set active tab can only be used in jig tabs docid\ published dsfpdovrld5oetm pzcfv the action set active tab needs to be referenced as a callback action which is used in conjunction with the action execute action how to configure the action the action is configured under the jigid in the jig tabs file give the action a unique name ( action identifier ) that will be used to reference the action in the tab's corresponding jig in the corresponding jig configure the action execute action and specify the unique name ( action identifier ) in the action property's value examples and code snippets basic set active tab in this example, when you are on the third tab (timelogs), a next appointment button at the bottom of the screen will open the first tab (appointments) note the action set active tab works in conjunction with action execute action using an action identifier jig tabs jigx type jig tabs title global inc aretabsscrollable false children \ jigid appointments title today icon calendar 3 \ jigid inventory title stock icon supply chain shipping fee included truck \ jigid timelogs title logs icon time clock circle 1 alternate actions \# give the action a unique identifier \# in the main jig use this identifier in the action execute action \# this creates the action button on the main jig \# to trigger the action next appointment type action set active tab options \# set the next tab that will open programatically, \# when the action button is tapped in the timelogs jig \# the id is the jigid of the tab you want to open next id appointments \ jigid manuals title help icon book book pages timelogs jigx title time logging description log the time taken to complete the job type jig default header type component jig header options height medium children type component image options source uri https //images unsplash com/photo 1456574808786 d2ba7a6aa654?w=500\&auto=format\&fit=crop\&q=60\&ixlib=rb 4 0 3\&ixid=m3wxmja3fdb8mhxzzwfyy2h8n3x8dgltzsuymgxvz3xlbnwwfhwwfhx8mg%3d%3d onrefresh type action reset state options state =@ctx components shift form state data children \ type component form instanceid shift form options children \ type component number field instanceid employee number options label employee number \ type component field row options children \ type component text field instanceid firstname options label name \ type component text field instanceid lastname options label last name \ type component email field instanceid email options label email \ type component text field instanceid contact options textcontenttype telephonenumber label contact number \ type component field row options children \ type component date picker instanceid shift date options label select shift date \ type component duration picker instanceid shift duration options label log your shift duration initialvalue 14400 helpertext standard shift is 4 hours errortext =@ctx component state value > 14400 ? 'shift time needs approval' '' hours step 4 minutes step 2 actions \ children \# to trigger the action set active tab in the jig tabs jigx, \# configure an action button to execute the action \# this button displays on the bottom of the jig, \# when tapped it will open the next appointment tab \ type action execute action options title next appointment \# reference the action identifier configured in the jig tabs action next appointment