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

Additional data structure #154

Open
Lewenhaupt opened this issue Jun 25, 2020 · 5 comments
Open

Additional data structure #154

Lewenhaupt opened this issue Jun 25, 2020 · 5 comments

Comments

@Lewenhaupt
Copy link

Hi,

I'm looking into how I could possible add an additional datastructure into ncform. My usecase is that I have a need to add "links" to dynamic values for certain fields. I must be able to persist this on my server and it should not be part of my schema. The links are not urls etc. but our own internal linking convention. Is my only option for this to fork the repo? I've tried looking but as runtime mixins aren't allowed in vue I can't find any obvious solution.

@daniel-dx
Copy link
Collaborator

Your question is whether the schema can change dynamically? If it is, just change the schema(new one) at runtime and re-assign it to ncform

@Lewenhaupt
Copy link
Author

Not exactly. I would want a third object. Currently we have the formSchema and formValue. And I would like to introduce a third one, for example "linkStructure". I guess I could work around this by simply storing this in a vuex store or similar and commit to that object from a custom theme component.

@Lewenhaupt
Copy link
Author

Hmm ok I looked into this a bit more. I can always access the closes FormItem fairly easily which gives me access to the formName which I can use to uniquely store an extra data structure somewhere else (such as a vuex store or similar). However, I can't seem to find a way to identify exactly where in the tree I currently am. "paths" to me sounds as if it should be, but it doesn't appear to give me the current location (only parent) and I've found, what I think is a bug with nested arrays.
Is "paths" the correct thing to be looking at here or should I gather this data from somewhere else?

@daniel-dx
Copy link
Collaborator

daniel-dx commented Jul 2, 2020

Can you give me an online demo, and show your needs? i am not sure i catch your meening

@Lewenhaupt
Copy link
Author

No online demo available. But should the "paths" variable be a valida JMES path for the current field in the form?

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