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
So the idea here is to fire a method for the array property when one of it's values get changes via the SyncInput action.
Example:
public$myArray = [0 => true];
<inputtype="checkbox" wire:model="myArray.0"/>
So when you now uncheck or check the checkbox, it will try to trigger updatingMyArray0($value) and updatedMyArray0($value). But in some cases, you would also want to listen to its parent, which is $myArray in this case. When this is the situation, Magewire should also trigger updatingMyArray(array $value) and updatedMyArray(array $value)
This discussion was converted from issue #48 on August 10, 2022 12:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So the idea here is to fire a method for the array property when one of it's values get changes via the SyncInput action.
Example:
So when you now uncheck or check the checkbox, it will try to trigger
updatingMyArray0($value)
andupdatedMyArray0($value)
. But in some cases, you would also want to listen to its parent, which is$myArray
in this case. When this is the situation, Magewire should also triggerupdatingMyArray(array $value)
andupdatedMyArray(array $value)
Beta Was this translation helpful? Give feedback.
All reactions