#How do I change a value of one dropdown based on another dropdown?

3 messages · Page 1 of 1 (latest)

acoustic grail
#

I have one dropdown (1st) which calls an api and adds value to another dropdown (2nd). Now from another page, we can change the value of this 2nd dropdown. When changed, I want the value of 1st dropdown to also change according to the 2nd one.

#
// your code here
 <card-section>
        <row>
            <drop-down  label="Auto Accident Type" control="accidentType" [gc]="Codes.AccidentType" [addEmpty]="true"
            (itemChange)="OnChangeAutoAccidentType($event)" [form]="form" col=6></drop-down>
            <drop-down  label="Claim Code" control="accidentClaimCode" [data]="ClaimCodes | async" 
            [addEmpty]="true" [form]="form" col=6></drop-down>
        </row>
        <row>
            <drop-down  label="Additional Factors" control="claimAdditionalFactorsCode" [data]="ClaimTypes | async" [addEmpty]="true" [form]="form" col=12></drop-down>
        </row>
    </card-section>
gusty pawn
#

You got to post ts code if you wanna better help.
In general, you should listen to Dropdown 2 changes from Dropdown 1 and not just in the other direction like you're already doing, and react accordingly.
Just be sure to not notify that specific change to Dropdown 2 too, or you'll create a loop.