Skip to content

Add example for Button action type "JS" and "args" #452

@MathiasAugstein

Description

@MathiasAugstein

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

I am struggling to pass arguments to an external JS function. context.args is always undefined, and I cannot find an example.

Describe the Feature you'd like

In exampleVault -> Buttons -> "Button Example.md", please add an example how an external JS function can receive arguments using the actions.args property.

Alternatives

In my case, I try to add a task with the title specified in an input. As I want to reuse the JS code I wrote it in a separate file. This use case might be popular among other people (use a button as "add" or "replace" of whatever is inserted in the input), so it might be worth writing an "Advanced Example".

But this would be second priority for me, clear example where people search it would be better.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationfeature requestNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions