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

Allow devs to select config items by group #124

Closed
keegan-lillo opened this issue Jun 27, 2016 · 0 comments · Fixed by #147
Closed

Allow devs to select config items by group #124

keegan-lillo opened this issue Jun 27, 2016 · 0 comments · Fixed by #147
Milestone

Comments

@keegan-lillo
Copy link
Contributor

[
  {
    "type": "input",
    "messageKey": "COOL_THINGS[0]",
    "defaultValue": "",
    "label": "Input Field",
    "group": "COOL_THINGS"
  },
  {
    "type": "input",
    "messageKey": "COOL_THINGS[1]",
    "defaultValue": "",
    "label": "Input Field",
    "group": "COOL_THINGS"
  },
]

Then to get the items in the group you would do:

var coolThingsItems = clayConfig.getItemsByGroup('COOL_THINGS')

As a temporary workaround you can do the following in your custom function:

clayConfig.getItemsByGroup = function(group) {
  return this.getAllItems().filter(function(item) {
    return item.config.group === group;
  });
}

var coolThingsItems = getItemsByGroup('COOL_THINGS')
@keegan-lillo keegan-lillo added this to the v1.1.0 milestone Jun 27, 2016
keegan-lillo added a commit that referenced this issue Oct 18, 2016
* Add getItemsByGroup function

* Update test

* update readme

* Update README for submit button

* Update docs with ID prop for button and submit components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant