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 to programmatically set t-rich-select value when using ajax #29

Open
louisjeck opened this issue Oct 29, 2021 · 3 comments
Open

How to programmatically set t-rich-select value when using ajax #29

louisjeck opened this issue Oct 29, 2021 · 3 comments

Comments

@louisjeck
Copy link

I'm currently using t-rich-select with fetch-options to search people in my database. I also use the dropdownButton (which btw doesn't have the props like dropdownDown used to) slot to show a quick add modal. Once the modal is closed and the new person saved to database, I'd like to show it as selected. I also need to be able to set a default value when the page loads.
I've looked in the source, created a ref and tried to call the selectOption method but I can seem to get it to work.
How should I proceed ?
Thanks

@louisjeck
Copy link
Author

And adding an option to the options prop array after onMounted hook also doesn't show the option. If I set during setup then I can have a default value. But I'd like to dynamically add an option and select it later.

@alfonsobries
Copy link
Contributor

alfonsobries commented Oct 29, 2021

@louisjeck I have no quick answer but ill see if possible when I work on the issue I mention here #28 (comment)

I'm going to be on vacation next week so I don't think will have a solution soon though 😔

@louisjeck
Copy link
Author

Okay, thanks for your reply, I'll wait then. The teleport prop also doesn't seem to work (is doesn't pass to the t-dropdown component).

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