C
|
Chris Whitehead 10/31/2024 |
I'd add a custom snippet on the edit/add page, this would retrieve the JSON key/value pairs from the field in the record. Then loop through then and echo out the bootstrap input box for each field. also add a prefix to the temp input name, then on save, loop through the temp fields adding to an array and unsetting the temp field as you populate the array, then json_encode the array and replace in the field name which you're storing the JSON key/value pairs in. I hope this makes sense, it might be quicker for me to knock up the snippet to show you if it doesn't. |
C
|
Chris Whitehead 11/1/2024 |
Hope this helps, it's a bit rough and could be made prettier and a bit shorter. this is just in any edit or add page, I've just used an array rather than dragging the fields from a table but I'm sure you'll be able to get the idea. I'm adding in the four fields which need a little styling to line them up ( I did say it was rough). Add a snippet in the designer which will build and echo out the fields. // field which is stored in the record Then in javascript_onload_event. // you could create a loop for this from the field names, this is so the values get passed in the POST. Then finally in the before_record_saved event. // fields which can be selected from the table then it will be dynamic |
R
|
rmac author 12/6/2024 |
Chris; Thanks for the input and the considerable work that you put into it! Sorry I didn't respond sooner, but didn't get a notice on the reply. I've been off on other issues, but will definitely give this a try. I hope maybe you or someone else could find a use case for it as well. Thanks again. Ray |
C
|
Chris Whitehead 12/7/2024 |
Rmac, Don't worry, I also did it for me as well so I can do the same. |