Skip to content

Render groups as bootstrap tabs #285

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

Closed
ericpyle opened this issue Sep 9, 2017 · 16 comments
Closed

Render groups as bootstrap tabs #285

ericpyle opened this issue Sep 9, 2017 · 16 comments

Comments

@ericpyle
Copy link

ericpyle commented Sep 9, 2017

Wishing I could use groups to render the form in a different way, like with each section having it's own tab. I could have multiple vfg instances with one form per tab. Or maybe I could use multi attribute to just hide all fields that are not in that tab.

Thoughts on best way to do this?

@ericpyle
Copy link
Author

Or use visibility function that can somehow determine which tab is in use?

@DelfsEngineering
Copy link

This works great:
Take your source schema and insert a function for the visibility field key's value

So if you want to show/hide field(s) based on the value of another field set their visibility to a function like

function(){
   return this.model.fieldA == 'someValue'
}

of course use what ever logic you want now.

@DelfsEngineering
Copy link

For tabs see vue-form-wizard here https://github.com/cristijora/vue-form-wizard

@ericpyle
Copy link
Author

@DelfsEngineering thanks so much for the suggestions! I'll definitely take a harder look at the vue-form-wizard. Know of any examples of how to make the tabs look like regular bootstrap tabs? It's possible that I could rethink whether my app should have more of a guided wizard UX, but converting my app over to how it currently works would be great.

@ericpyle
Copy link
Author

@DelfsEngineering also, do you know of any examples of how the multi field and multiple option is used in practice? I see what the documentation says, but I suspect there's a use-case or use-cases behind supporting that and the merge logic that respects multi. Thanks again for any help!

@DelfsEngineering
Copy link

I suppose the best you could do without forking vue-form-wizard is some injected CSS, or hacking the accompanying CSS.

@cristijora
Copy link
Collaborator

cristijora commented Sep 12, 2017

Hey @ericpyle
For tabs
https://github.com/spatie/vue-tabs-component
https://github.com/cristijora/vue-tabs

For a more strict flow/wizard
https://github.com/cristijora/vue-form-wizard
The wizard supports tab layout, however they do not act like tabs since the wizard has a stricter validation flow (e.g you can't click a tab unless it was visited and validated)
https://jsfiddle.net/bt5dhqtf/99/

If you need tabs and more flexibility use tab components.
If you need a stricter validation flow use the wizard. Both tabs and the wizard should work fine with form-generator.

@ericpyle
Copy link
Author

Thanks, @cristijora. I'll look into integrating vfg with the other tab components and also ask my team whether we want to move toward a wizard approach.

@DelfsEngineering I still have an outstanding question about use cases for multi and multiple in vfg, if anyone cares to share?

@cristijora
Copy link
Collaborator

cristijora commented Sep 13, 2017

@ericpyle you mean multi select ? A select with multiple options? Not sure I understand what multi refers to. Maybe send a link from the docs where you saw it

@ericpyle
Copy link
Author

I mean multi field property "if true, it will visible only if multiple is true in component attributes" https://icebob.gitbooks.io/vueformgenerator/content/fields/field_properties.html

@ericpyle
Copy link
Author

@cristijora see reply above. Thanks!

@cristijora
Copy link
Collaborator

cristijora commented Sep 13, 2017

@ericpyle Honestly not sure to what it refers. I've used the multiple property only on multi-select field which has vue-multi-select behind it.
Maybe @icebob or @lionel-bijaoui could answer to this.

@ericpyle
Copy link
Author

as far as this issue goes, I'm ready to close it. I think if needed, I could have one vfg instance that gets reloaded each time a user switches tabs.

@icebob before I close this, could you please explain what the multi field property is used for in conjunction with multiple vfg option? I've seen the documentation, but I haven't seen working examples to help me understand what it's used for

@zoul0813
Copy link
Member

@ericpyle can we close this?

@ericpyle
Copy link
Author

@zoul0813 yes

@timoteo7
Copy link

timoteo7 commented Jul 30, 2020

hey @cristijora
using :
https://github.com/cristijora/vue-tabs

is there any easy way (or if it is possible) to convert the fieldset (from the group scheme) to v-tab?

some as in the example of this subgroup ('Location') in #670

tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants