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
What is the best way to save Unyson options json ? #387
Comments
Database values differs from form input values. There is no way/possibility to manipulate/use/change options form values from js, form is generate and saved by option types on server side. Option type is allowed to do anything it wants with form inputs (it's a private zone for it), the requirement is to return a good/valid/simple value from
In that textarea can be only db values (not form input values extracted with js), and the import can work only through server side db values update (not updating from inputs from js the submitting the form), for e.g. the values are update in the database then the form is refreshed and will show the new values. From js you can use these 2 ajax actions to render form inputs html from options array and their values array, and with second action to extract the values in db format from form inputs (the code examples are from |
:) that is what I finally did and you figured out what I am doing. In short , I am adjusting in options, say , change the font color |
OK one pesky bug is messing with me , I managed to get all options exactly as needed just the typography option style select is messing with me and gives me 2 selected options , this is what I have
But I get this this is the option array printed
what am I missing ? value not a string or? if I do this in typography option
instead of
but that messes up the js selection on load. must be variable type. but how if the arrays are identical. |
darn , it is , my array style is integer instead of string |
Sorry, I don't understand, doing
fixes the select problem or not? (I think it should) |
well yes for php , but than messes it up for js
and somehow my value gets converted to integer via json_decode I guess |
You dont have to assign anyone , I dont think this is your (Unyson) issue , it is my json array that should be corrected , look http://prntscr.com/6j9xol |
I think that |
yes, that fixes it , but note that you would have to fix default selected in js, since it defaults to 300 since none of them has selected via js
|
I tried several parsing options and form values to json jq plugins but some of them do not get unyson options right because some of the values either have same option name like addable options and some of the values are json values.
http://prntscr.com/6j2jkz
that one should have been parsed in to a sub array
http://prntscr.com/6j2kvc
Something like redux has is what I am looking for and it would be nice to have it by default actually or some kind a fw form helper method that would do this.
http://prntscr.com/6j2h6v
The text was updated successfully, but these errors were encountered: