Jump to content

Simple htmx question...


MarkE
 Share

Recommended Posts

I think this works @kongondo

$(document).on('reloaded', '.InputfieldRepeater', function (event) {
    htmx.process(this);
})

Now I have the (non-trivial) task of working out how to target the right repeater item and swap in the converted measurement ?

  • Like 1
Link to comment
Share on other sites

54 minutes ago, MarkE said:

I think this works

Great! ?.

54 minutes ago, MarkE said:

Now I have the (non-trivial) task of working out how to target the right repeater item and swap in the converted measurement ?

I'd say this is the trivial bit. The repeater items already have your hx-attributes, so they should target the right repeater item. Alternatively, you can find out about the item in the this that you pass to htmx.process() above.,

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

Thanks @kongondo. Just enhanced and fixed a few bugs in the new 'in field' conversion feature in v0.0.10. I tried to use hyperscript to do this, given its purported 'compatibility' with htmx, but I came across the same problem with lazy-loaded fields as we had with htmx - i.e. it didn't trigger when used in a field inside a repeater matrix item. However, there didn't seem to be a similar ready fix for this, so I resorted to good old fashioned jQuery which seems to work OK ?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...