Skip to content

Instantly share code, notes, and snippets.

@ichim-david
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save ichim-david/6a4e74d2bcaff9ae863c to your computer and use it in GitHub Desktop.

Select an option

Save ichim-david/6a4e74d2bcaff9ae863c to your computer and use it in GitHub Desktop.
not in javascript
var values = [{one : 'value'}, {two: 'value'};
var field = "field";
var ct_setting = { ctype: ctype,
settings: [
]
};
ct_setting.settings[field] = {};
jQuery.each(values, function(idx, option) {
ct_setting.settings[field][option.name] = option.value;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment