MarkE Posted March 19, 2022 Author Share Posted March 19, 2022 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 ? 1 Link to comment Share on other sites More sharing options...
kongondo Posted March 19, 2022 Share Posted March 19, 2022 (edited) 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 March 19, 2022 by kongondo 1 Link to comment Share on other sites More sharing options...
MarkE Posted March 21, 2022 Author Share Posted March 21, 2022 All working fine now. Many thanks for your help @kongondo (and @Robin S). New version 0.0.9 of FieldtypeMeasurement is now on GitHub https://github.com/MetaTunes/FieldtypeMeasurement Do you think this is worth adding to the modules library? 1 Link to comment Share on other sites More sharing options...
kongondo Posted March 21, 2022 Share Posted March 21, 2022 11 hours ago, MarkE said: Do you think this is worth adding to the modules library? Of course ?. You can still tag it as alpha even POC if you needed to. Link to comment Share on other sites More sharing options...
MarkE Posted March 25, 2022 Author Share Posted March 25, 2022 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 ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now