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 to give a widgetId to the render() function #93

Open
maberer opened this issue Sep 22, 2015 · 0 comments
Open

Allow to give a widgetId to the render() function #93

maberer opened this issue Sep 22, 2015 · 0 comments

Comments

@maberer
Copy link
Contributor

maberer commented Sep 22, 2015

We need a way to reference a client side rendered child (inner) widget without the need to hold a reference to it from the parent...

Because holding a reference to a inner widgets requires to listen to its lifecycle events to prevent memory leaks (when holding a direct reference to the widget), or to invalidate the string ID (if that is stored) if the inner widget gets destroyed.

When there would be a way to give a name/id at render time, the inner widget could be easily be referenced later with this.getWidget("widgetID")

Something like that would do it (probably):

myComponent.render({ widgetId: this.getElId('foo' })

The this.getElId('foo') method would be used to generate the fully qualified DOM element ID for the newly rendered component that is then appended to the parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants