eclipsesource / eclipsesource/tabris-js

Allow deeply nested widget to easily access its ancestor's "model"?

Open
#564 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

This happens fairly often and results in code that I'm quite uncomfortable with, so I would like to see if there are actually better ways for me to do this or if there aren't, whether the suggestion below is feasible or orthodox, or maybe there's already a feature in the pipeline which will address this concern.

OK, first, the problem. Often, when I generate a collection of widgets by iteration, I would need to associate an object/model to each of the widget. Each of this widget may contain deeply nested widgets, one of which could be a button, which then requires it to access or update a property of its ancestor object/model when it is selected. Right now, this is how I do it.

```
var models = [ {...}, {...}, {...} ........, {...} ];
for (var i=0; i

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.