Hi,
I am using datatables in a project. I open it in modal form to update the data. While updating this data, I am pulling the dropdown data.
But when I try to give default data, it doesn't work either. The data I selected is coming in continuously.
I want to give dropdown default value every time I select it. How can I do that.
ClaimList = [
{ OperationClaimId: 1, name: "User" },
{ OperationClaimId: 2, name: "Admin" },
]
UserClaimsEdit= new FormGroup({
UserId : new FormControl(),
OperationClaimId : new FormControl()
});
UserList:any=[];
stringifiedData:any;
parsedJson:any;
emSelected:any;
dtOptions: DataTables.Settings = {};
dtTrigger: Subject = new Subject();
ngOnInit(): void {
this.getUsers();
this.emSelected=1;
this.dtOptions={
pagingType: 'full_numbers',
pageLength:5,
lengthMenu:[5,15,25]
};
}
getUsers()
{
this.service.getUser().subscribe(data=>{
this.UserList=data;
this.dtTrigger.next(this.dtOptions);
});
}
Ali YlmazPosted Mar 21, 2022, 8:18 AM