PricingDocsAcademy
Bluesky ...
Fri, Dec 13, 8:06 AM

Draggable element - When to use event formula, normal formula or a workflow?

  • mesmoiron

    2 months ago

    Hello,

    I am working on making elements move/drag over the canvas with the example of W3Schools
    https://www.w3schools.com/howto/howto_js_draggable.asp

    I tried to rewrite the code into event actions and then create a workflow. This didn't work out, mostly because I don't quite have the intuitive feeling when to use actions, formula and workflows and script tag. I have moved the code into the script tag section. It works finally ;-). But I am still puzzled about it. Can I move the code from the script into an onload event? The bigger question behind my questions is: how to think in a Toddle way when rewriting code. Maybe we can have a new awesome video about that? Please ๐Ÿ˜บ
  • @mesmoiron
    Hello,

    I am working on making elements move/drag over the canvas with the example of W3Schools
    https://www.w3schools.com/howto/howto_js_draggable.asp

    I tried to rewrite the code into event actions and then create a workflow. This didn't work out, mostly because I don't quite have the intuitive feeling when to use actions, formula and workflows and script tag. I have moved the code into the script tag section. It works finally ;-). But I am still puzzled about it. Can I move the code from the script into an onload event? The bigger question behind my questions is: how to think in a Toddle way when rewriting code. Maybe we can have a new awesome video about that? Please ๐Ÿ˜บ

    Lucas G

    2 months ago

    Drag and drop API is actually available in the toddle UI. You can set the actions through the events panel (where you see click, input, etc events)
  • As far as when to use what, custom actions are meant to be a supplement to the UI
  • For example using a third-party library in your project
  • Thatโ€™s something for a custom action
  • Lucas G

    2 months ago

    Imo, use the script tag sparingly. Only for small snippets. I recommend most things be done through the UI first, custom actions/formulas second
    ๐Ÿ‘1

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code โ€” but accessible to your entire team!

Try toddle โ€” it's free!

ยฉ Copyright 2024 toddle. All rights reserved.