F
Filamentβ€’8mo ago
FACHRI

Dependant Select

Hello, I want to ask. I have a filament resource called "Project". it contains "Dependant Select" in the Teams field then I also have a relationship manager with the name "TimesheetRelationManager". How about when I select Teams it automatically reacts to the selection in "TimesheetRelationManager". Thank you
No description
No description
No description
No description
No description
17 Replies
Dennis Koch
Dennis Kochβ€’8mo ago
How about when I select Teams it automatically reacts to the selection in "TimesheetRelationManager".
How should it react? Isn't that more like a filter?
FACHRI
FACHRIβ€’8mo ago
I mean, when I select "teams select field" in project resource, it can react selecting "members select field" in timesheetrelationmanager. You could say this is dependent select on different resources.
Dennis Koch
Dennis Kochβ€’8mo ago
But where? Inside the the Edit Modal?
FACHRI
FACHRIβ€’8mo ago
No description
No description
Dennis Koch
Dennis Kochβ€’8mo ago
Okay, so you want to populate the Members field based on the current project? Can't you just select this from the Database? Or should this also work without saving? Then you could try accessing the data via $livewire->data['team_id']
FACHRI
FACHRIβ€’8mo ago
i try with this code but not work
No description
Dennis Koch
Dennis Kochβ€’8mo ago
That's not what I told you. $get() is looking in the same form. And please answer my questions
FACHRI
FACHRIβ€’8mo ago
do you mean like this ?
No description
Dennis Koch
Dennis Kochβ€’8mo ago
Yes. Does $livewire refer to the EditPage? Then it should contain the right data.
Sjoerd24
Sjoerd24β€’8mo ago
Hmm this is maybe also the answer to my problem, what do you have to include to make this work? This: use Livewire\Livewire; Doesn't seem to work.
Dennis Koch
Dennis Kochβ€’8mo ago
It's Component $livewire not Livewire $ivewire
Sjoerd24
Sjoerd24β€’8mo ago
thanks!! I clearly have to learn more about livewire, clearly I am missing some stuff πŸ˜…
FACHRI
FACHRIβ€’8mo ago
I am sorry for late reply. I have tried it but an error appears as attached
No description
Dennis Koch
Dennis Kochβ€’8mo ago
Hm, not sure whether you can access the parent form then.
toeknee
toekneeβ€’8mo ago
$livewire->parentElement or similar? in v3 isn't it?
FACHRI
FACHRIβ€’8mo ago
actually there is something that needs to be straightened out. This menu is in relationsmanager, not in the project resource edit page Maybe this is the same as calling the parent of the select field into the child select field of another resource of course, it's in v3
toeknee
toekneeβ€’8mo ago
I am saying I beleive using parentElement or similar in V3 is the correct approach over just $livewire since that returns the current element.