-
Notifications
You must be signed in to change notification settings - Fork 649
allow to define a pre-existing HTML layout where fields will be inserted #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to define a pre-existing HTML layout where fields will be inserted #112
Conversation
I've started testing it a bit, added a If you run bootstrap-example.html in that branch it starts out fine, but changing anything in the form definition (triggering an update) doubles the fields inserted by |
oh, ok, let me have a look |
Ok, the slot need to be cleaned up everytime we insert the field. |
Great! Just skip the dist files, makes the merge easier :)
|
done |
Heads up! I fixed the code up a bit so it only does one querySelectorAll instead of multiple querySelector and added support for complex keys, doing that I had to change the syntax a bit. Basically the value part of the So <div sf-insert-field="name"></div> becomes <div sf-insert-field="['name']"></div> And complex keys works <div sf-insert-field="['foo']['com-plex']"></div> In development, commit here: |
We can define an HTML layout in the FORM tag, it will be preserved by the form directive, and if it contains some tags with a
sf-insert-field
attribute, the corresponding fields will be inserted at this position (the other fields will be generated bellow). Example:It is a way to allow to build a specific layout manually in a very flexible way.