Comments (7)
Best @ramedina86,
How does this work using a slider inside a repeater?
Binding does not work as you mentioned above, so how would a default value be set?
This is my handler function and it works:
def handle_set_chunk_size(state, context, payload):
name = context["itemId"]
state["loaded_documents"][name]["chunk_size"] = payload
But when initializing the repeater the slider has no value:
Binding it directly to for instance item.chunk_size
seems more intuitive to me (no need to create such a event handler & can set default initial value).
Kind regards,
Caspar
from streamsync.
The documentation should be clearer, thanks for reporting this. This is expected behaviour though, as you cannot bind to context, only to state.
You can create an event handler using state and context to achieve this. There's an example here at the bottom
Thank you for trying Streamsync and providing feedback. Let me know if I can help.
from streamsync.
Hey Caspar, this is a great point -thanks for bringing it to my attention.
I'll reopen the issue. It'll be quite challenging to implement this, but worth it.
from streamsync.
Hey @ramedina86,
Has a fix for this been implemented already? Or a temporary work around that you can think of?
Best regards,
Caspar
from streamsync.
Hi @Capsar not yet, though it hasn't been forgotten, it'll be implemented before the end of month.
from streamsync.
Hi @Capsar it's now possible (v0.2.8) to bind inside a Repeater using dynamic accessors, providing the functionality you detected was missing and some more.
For example, persons[itemId].height
where itemId
is the one generated by the Repeater.
This also gives you the chance to use itemId
to point to a completely different dict. Although this was inspired by this issue specifically, it works outside Repeater as well.
from streamsync.
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": []
})
from streamsync.
Related Issues (20)
- Problem with StreamSyncState HOT 2
- Redirect after authentication on http://localhost without / HOT 8
- HTML in displayed strings HOT 3
- Collapsable navigation bar HOT 3
- Content alignment spread
- Ability to Filter file uploads based on mimetype
- the WF engine should resolves escaped variables
- custom component name should be constrained explicitely HOT 3
- npm run custom.dev run dev server instead of custom.dev
- run custom.dev may raise error when started HOT 1
- Connection rejected. HOT 5
- Custom styles for image container HOT 1
- Apply suctom styles to images dynamically HOT 1
- custom stylesheet and js are not loaded after OIDC authentication HOT 1
- unauthorization actions can not be customized on oidc and basic auth authentication
- Add Metadata for social media sharing
- Multiple leftbars in mobile view HOT 1
- visibility attribute on backend ui broke the application in 0.7.2
- support for floating numbers and large numbers on the slider
- Allow CLI to find a different port
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamsync.