{"action":"created","issue":{"url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/913","labels_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/913/comments","events_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/913/events","html_url":"https://github.com/ThemeFuse/Unyson/issues/913","id":109791797,"number":913,"title":"How to properly use fw_backend_options_render in ajax?","user":{"login":"danyj","id":2340172,"avatar_url":"https://avatars.githubusercontent.com/u/2340172?v=3","gravatar_id":"","url":"https://api.github.com/users/danyj","html_url":"https://github.com/danyj","followers_url":"https://api.github.com/users/danyj/followers","following_url":"https://api.github.com/users/danyj/following{/other_user}","gists_url":"https://api.github.com/users/danyj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyj/subscriptions","organizations_url":"https://api.github.com/users/danyj/orgs","repos_url":"https://api.github.com/users/danyj/repos","events_url":"https://api.github.com/users/danyj/events{/privacy}","received_events_url":"https://api.github.com/users/danyj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-05T13:04:25Z","updated_at":"2015-10-06T09:29:35Z","closed_at":"2015-10-05T19:18:42Z","body":"OK this is becoming ridiculous and I refuse to believe that this is the way this should be done.  \r\nPlease help me out here. \r\n\r\n I have in theme/options    file topmenu.php   that contains $options array of 20 options for top menu. \r\n\r\nThan I have  topmenu  current  options  serialized  and saved to a file  , just an example \r\n\r\n    fw_options%5Bmenupreset%5D=style1&f.......\r\n\r\n\r\nId rather use JSON but according to this way of doing things it needs to be serialized\r\nhttps://github.com/ThemeFuse/Unyson/blob/bdc4f3ab1ed59e2c0b1ded227eb093cd1f556b4a/framework/static/js/fw.js#L933\r\n\r\n\r\nNow in order for me to re-render  my saved options , I need to : \r\n\r\n\r\n    run ajax to get options default array   by looking in to topmenu.php ( why? ) \r\n    run ajax to get my saved serialized preset\r\n    run ajax  to  get the values  with  fw_backend_options_get_values ( why? ) \r\n    run ajax to render and return html with  fw_backend_options_render\r\n\r\nis there any way to shorten this madness? \r\n\r\ncan I use just  max 2 ajax calls  ? \r\n\r\n\r\n    run ajax to get my preset \r\n    run ajax to rerender  \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/comments/145797148","html_url":"https://github.com/ThemeFuse/Unyson/issues/913#issuecomment-145797148","issue_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/913","id":145797148,"user":{"login":"danyj","id":2340172,"avatar_url":"https://avatars.githubusercontent.com/u/2340172?v=3","gravatar_id":"","url":"https://api.github.com/users/danyj","html_url":"https://github.com/danyj","followers_url":"https://api.github.com/users/danyj/followers","following_url":"https://api.github.com/users/danyj/following{/other_user}","gists_url":"https://api.github.com/users/danyj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyj/subscriptions","organizations_url":"https://api.github.com/users/danyj/orgs","repos_url":"https://api.github.com/users/danyj/repos","events_url":"https://api.github.com/users/danyj/events{/privacy}","received_events_url":"https://api.github.com/users/danyj/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T09:29:35Z","updated_at":"2015-10-06T09:29:35Z","body":"ok , thnx for the info about JSON,  \r\nbut  \r\n>What stops you from doing that?\r\n\r\nwell seems like I must run this in the way I described above \r\n\r\nFirst ajax is to get the default array structure so that it can be compared to the option value\r\nSecond one is  to get my serialized options that are saved in a file  \r\n\r\nthird is to get options from values required for render\r\nhttps://github.com/ThemeFuse/Unyson-Framework/blob/master/core/components/backend.php#L659-L666\r\n\r\nfourth is to render \r\n\r\nhttps://github.com/ThemeFuse/Unyson-Framework/blob/master/core/components/backend.php#L578-L585\r\n\r\nor am I missing the point here in those actions ?\r\n\r\n"}}