MrPaperbag
Enable disabled button after creating related item
I have the following action on my resource, and as you can see it is checking if the record has 1 or more rounds connected to it. In the gui the action is displayed above the table where the rounds are displayed via a relationmanager.
Can I make this disabled/enabled state change interactive, so I dont have to actually reload the page after adding another round(s)?
Any help would be much appreciated. Thank you in advance.
1 replies
Create related resource with another relationship
I am making an app to record games, rounds per game, and scores per player per round. I now have a GameResource with a RoundsRelationManager.
On the Game's Edit page I have a table with the rounds and a button to add a new round. I want to open a modal with a form to create a new round.
The modal should have a form with the following fields:
- Round number (property of the Round model, must only be visible and is a calculated field)
- Points per player (property of the Score model that is connected to the Round)
- Winner ID (player ID of the winner, must be calculated upon saving of the Round and Score models, not visible in the dialog)
Now I am diving into the possibilities of creating both the Round and Scores using mutate methods and such, but I feel like there must be a better way to do this that utilizes the relationships in between the models.
I am new to filament, and I am not sure how to approach this.
Some help would be appreciated.
Below is the code I have so far, including a database sketch (players are actually the users in this case):
2 replies