Web component: j-Exec


  • Info
  • HTML
  • JS
  • CSS
  • Meta

j-Exec

The component has a similar functionality like j-Click but it can handle multiple clicks / elements. RECOMMENDATION: add this component into the <body> element.

Configuration:

  • selector is a selector for capturing click (default: .exec)
  • selector2 is a selector for capturing dblclick (default: .exec2)

Elements:

  1. Elements can contain data-exec attribut with a method name which will be execute when the user click on the element.
  2. Elements can contain these attributes data-path="some.path and data-value="'STRING'" or data-value="340" (number) or data-value="{}" (object). Clicking on the element sets data-value to data-path.
  3. Elements can contain data-href attribute and the component performs REDIRECT().

Attributes:

  • data-exec="METHOD_NAME" executes a method when user clicks (supports scope via ? char)
  • data-prevent="true" prevents continuing click event
  • data-href="URL" performs REDIRECT()
  • data-path="path.to.property" a path for setting of value (supports scope via ? char)
  • data-value="" sets a value according to the data-path="" attribute
  • data-def="path.*" performs default values (supports scope via ? char)
  • data-reset="path.*" performs a state reseting (supports scope via ? char)

Attributes for double click:

  • data-exec2="METHOD_NAME" executes a method when user clicks (supports scope via ? char)
  • data-prevent2="true" prevents continuing click event
  • data-href2="URL" performs REDIRECT()
  • data-path2="path.to.property" a path for setting of value (supports scope via ? char)
  • data-value2="" sets a value according to the data-path="" attribute
  • data-def2="path.*" performs default values (supports scope via ? char)
  • data-reset2="path.*" performs a state reseting (supports scope via ? char)

Hints:

  • toggles boolean data-value="!value"
  • scopes: data-path="?.name" replaces ? char with a scope path

Author

Browser‘s Save action performs Preview