Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How i can get auto selected coming from database #157

Open
etwordpress01 opened this issue Dec 16, 2020 · 1 comment
Open

How i can get auto selected coming from database #157

etwordpress01 opened this issue Dec 16, 2020 · 1 comment

Comments

@etwordpress01
Copy link

Hello, Is there any options to selected automatically coming from database .

I passed my single select key as an array but it is not being selected. Should i need to trigger once i pass the value to state ?

Screenshot 2020-12-16 at 8 42 35 PM

When i pass direct value to state then it get selected but when i pass in multiselect selected items then it didn't being selected

1

Thanks

@Ashutoshcrowdapps
Copy link

You can add unique id as a string
eg. if you have multiple id in a array oldids= [{id:1,name:'x'},{id:2,name:'y'}]
just get all ids as a string in a array =
let newIds = oldIds.map(item=>item?.id.toString())

now pass newIds in selected props
and it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants