-
Notifications
You must be signed in to change notification settings - Fork 29
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
Dynamically add items into the page #4
Comments
How would you go about setting appKeys? How does the current implementation work as far as serializing the data? |
My current implementation doesn't actually serialise any data back to the Pebble - it sends it to my server via an ajax post request, but that's not really the point. I should probably open another issue for that though - since it's a very common use case if you're working on a timeline enabled app. :-) The way I currently handle it is by using html arrays. Consider these basic form elements:
The data would be received with an array for each of
I don't really know how this would apply to appKeys, etc... but it's definitely a valid use case for complex apps with multiple configurable "things". |
Interesting... {
type: 'dynamic-group',
structure: [
// Any combination of components
{
type: 'input',
appKey: 'name',
label: 'Name'
},
{
type: 'color',
appKey: 'fave_color',
'Favorite Color'
}
]
} And would end up being serialized into something like: {
name: ['Joe', 'Fred'],
fave_color: [0xFF0000, 0x00FF00]
} |
Yeah, something like that should do what I need it to do! :-) |
Sorry for bumping this one, but wanted to add one requests for the future {
type: 'dynamic-group',
min-items: 1, // this might be the value by default
max-items: 10,
structure: [
{
type: 'input',
appKey: 'name',
label: 'Name'
},
{
type: 'color',
appKey: 'fave_color',
'Favorite Color'
}
]
} |
Is this currently possible via a Clay Custom function, or is it impossible unless the package is updated to handle dynamic fields? |
@ignat980 You could achieve it with a custom component, but it will not be trivial. Sorry. |
For Habits I need to add and remove new form elements for each Habit that the user wants to manage. I've looked through the readme, but it doesn't sound like this is supported in Clay.
Is this something that can be considered and added to the roadmap?
The text was updated successfully, but these errors were encountered: