You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a setup method in almost all my widgets that sets a instance variable that should be presented by the widget. I use the after_initialize callback method to call setup. Often however do i want to pass this instance to a child widget, but the setup method is called after has_widgets so it's not set yet. Is their a way to change this order?
Example:
classUsageWidget < Apotomo:Widgetafter_initialize:setuphas_widgetsdo |root|
self << widget("usage/graph",:graph,usage: @usage)# doesn't work, @usage is not set yetenddefdisplayrenderendprivatedefsetup(widget)@user=options[:user]@organization=options[:organization]@usage=UsagePresenter.new(@user,@organization,view_context)endend
The text was updated successfully, but these errors were encountered:
I have a
setup
method in almost all my widgets that sets a instance variable that should be presented by the widget. I use theafter_initialize
callback method to call setup. Often however do i want to pass this instance to a child widget, but the setup method is called afterhas_widgets
so it's not set yet. Is their a way to change this order?Example:
The text was updated successfully, but these errors were encountered: