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 question about going one step beyond your example in the docs -- Can force_render be applied to a list of children components? I'm struggling to get this to work as expected. For example say I add the following method & html to the table component:
# method added to TableViewdefbegin_edit_all(self):
forchildinself.children:
ifhasattr(child, "is_editing"):
print("child set to editting")
child.is_editing=True# child.force_render = True # doesn't trigger refresh# self.force_render = True # doesn't trigger refresh
<buttonunicorn:click="begin_edit_all"
type="button">
Edit All
</button>
My attempts to force_render child components fail. And as a more complex example, using filter + begin_edit_all applies to all books rather than those that have been filtered:
A more realistic example of this would involve a table where you want to apply a status to all child components. For example, we could have a list of tasks that are filtered down and then you apply a set_status_complete to these filters items - that updates the table + status column.
The text was updated successfully, but these errors were encountered:
I can confirm that I am also witnessing the behaviour you've described.
I would also highlight an even simpler case taken from the example in the documentation. It seems that setting the value of children from the parent doesn't produce the desired effect:
defload_table(self):
self.books=Book.objects.all()
forchildinself.children:
ifhasattr(child, "is_editing"):
child.is_editing=True# This is not having any effect whatsoever
Branching from #662
I have a question about going one step beyond your example in the docs -- Can
force_render
be applied to a list of children components? I'm struggling to get this to work as expected. For example say I add the following method & html to thetable
component:My attempts to
force_render
child components fail. And as a more complex example, using filter + begin_edit_all applies to all books rather than those that have been filtered:Here are the files for this example:
mysite_example3.zip
A more realistic example of this would involve a table where you want to apply a status to all child components. For example, we could have a list of tasks that are filtered down and then you apply a
set_status_complete
to these filters items - that updates the table + status column.The text was updated successfully, but these errors were encountered: