Making user-defined fields/dynamically created fields editable

neqis
neqis

I'm working on some DSTs that allow players to create some fields while editing the sheet. Since the fields can be dynamically created, they don't exist when the sheet is first loaded. Consequently, the field editor isn't connected to them (clicking on what should be an editable field has no effect). For fields created after page load, how can they be made editable by the sheet field editor? I could hook up my own editor, but would rather not add a module that replicates existing behavior.

Comments

  • neqis
    neqis
    Posts: 11 edited May 14

    I think I found it after digging around in Jp12x's "nWoD RELOADED!" sheet. The globally accessible aisleten.characters has two methods, bindField(fieldName, containerId, slug) and bindAllFields(slug, containerId) that set up editable fields.

    Post edited by neqis on
  • thaen
    thaen
    Posts: 928

    You might also take a look at "Kallak's Pathfinder 2E (mobile/tablet friendly)" DST.

    https://www.obsidianportal.com/dynamic_sheet_templates/374

    It has some dynamically added sections.

    Obsidian Portal Developer

  • neqis
    neqis
    Posts: 11

    Thank you for the suggestion. That looks to use ChainsawXIV's library, which has its own editor. I may go that direction at some point, but for now bindField meets my requirement.

  • thaen
    thaen
    Posts: 928

    Awesome!  Glad you have a solution!

    Obsidian Portal Developer

Sign In or Register to comment.

May 2022
Revenge on the Kraken's Bane

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions