A way to access the parent of a control #950
Replies: 2 comments 1 reply
-
Yes this would be very much helpful I also got into this problem and @ndonkoHenri helped. It would have certainly be much easier to wrap my head around it if I could just access the current control's parent. |
Beta Was this translation helpful? Give feedback.
-
|
It won't be hard to add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@FeodorFitsner, what do you think of adding a way to access the parent of a control?
I thought of this idea because alot of guys have been asking how to delete an item from a
ListView(ListTile) when a button/Control in the tile is pressed.The way I solve this issue was to always add a reference to the tile in the
dataproperty of theControlwhich will be used to delete the tile... and when the required event happens, grab thee.control.data(the ref), andremoveit from theListView.controlslist. Nevertheless, I think a better, efficient, and alternative approach could be to access the parent of that Controle.control.parent(the ref), andremoveit from theListView.controlslist.Why could this be useful?
Using references could become an issue or fail when the
Controlkeeping that reference is moved elsewhere. Whereas, using the.parentis cleaner and will never fail, because when theControlwe need is moved any where, it's.parentis changed to its new parent.I maybe poorly explained my thoughts, but
.parentcould be used in many other areas.Let me know what you think of this.
I just had the idea, but don't even know if it will be possible to implement :)
Beta Was this translation helpful? Give feedback.
All reactions