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

Update Repeater docs to explain use of dynamic accessors #288

Open
ramedina86 opened this issue Mar 6, 2024 · 0 comments
Open

Update Repeater docs to explain use of dynamic accessors #288

ramedina86 opened this issue Mar 6, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ramedina86
Copy link
Collaborator

          How is this supposed to work? Is this JUST for the binding of components to items in the repeated items.

Using your example from the docs (hint...you may want to update the docs for this use)

articles[itemId].colour

Could be bound to some dropdownselect or some other input, so a user could SET the colour to some value and it will be updated in the state for "articles"?

For display we still use

@{itemId.colour}

Could be somewhat confusing to use two separate notations, but I guess the point for this is that now you could do something like

otherstate[itemId].someattribute

and set an attribute in some other state item, here now "otherstate".

ss.init_state({
    "articles": {
        "Banana": {
            "type": "fruit",
            "colour": "yellow"
        },
        "Lettuce": {
            "type": "vegetable",
            "colour": "green"
        },
        "Spinach": {
            "type": "vegetable",
            "colour": "green"
        }
    },
    "order_list": []
})

Originally posted by @thondeboer in #26 (comment)

@ramedina86 ramedina86 added the documentation Improvements or additions to documentation label Mar 6, 2024
@ramedina86 ramedina86 self-assigned this Mar 6, 2024
@ramedina86 ramedina86 assigned mmikita95 and unassigned ramedina86 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants