Skip to content
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

Unable to edit loaded fields from database #13

Open
Vanguardo66 opened this issue Aug 20, 2020 · 5 comments
Open

Unable to edit loaded fields from database #13

Vanguardo66 opened this issue Aug 20, 2020 · 5 comments

Comments

@Vanguardo66
Copy link

Hi, first of all its so great. Actually it is fantastic. I love it.

I need a little help. When the user create a form for the first time, I save the formData as JSON in database and after that when the user reloads the old schema ans it is json parsed into formData there is no way to delete and/or edit old fields.

any suggestions would be appreciated.

@baggachipz
Copy link
Owner

You should be able to load the data into the variable you pass to v-model, provided it's in the same format. I would suggest loading the data in the created lifecycle event of the parent vue component and then invoking the q-form-builder component and pass that data in as the v-model. If you're having trouble with that, could you post some examples (i.e. through something like pastebin) and I can take a look.

@Vanguardo66
Copy link
Author

Vanguardo66 commented Aug 20, 2020

Thanks man for the quick reply. This is exactly what I have done. but neither I can edit a field nor delete it

created() { this.commonSetPageTitle("Form Schema") this.$q.loading.show({ spinner: QSpinnerGears }) this.fetch() }, methods: { fetch() { this.formFetch(this.$route.params.slug) .then(() => { if (this.formGetItem.schema) this.formdata = JSON.parse( this.formGetItem.schema.schema ) }) .finally(() => { this.$q.loading.hide() }) },

I will send a pastebin link ASAP.

@Vanguardo66
Copy link
Author

Sorry. I don't know why the codes are not formatted accordingly.

@Vanguardo66
Copy link
Author

Vanguardo66 commented Aug 20, 2020

CodePen

Here is the code pen but I couldn't figure how to include Quasar in it so it is not running the code

Screenshot from 2020-08-21 04-11-53

And the screen shot is after fetching the saved schema from DB. As you can see there is no delete button and also the edit tab is disabled (grayed out)

@baggachipz
Copy link
Owner

I would suggest stripping it all down to bare essentials, like not using Vuex. Put the value(s) you want to load right into a data object and pass that to v-model. If you can get that working, add in things like Vuex and see how it differs. Have you checked out and run the demo locally? I think it would give you a lot of insight into how to set up and run things.

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

2 participants