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

Can we do AJAX search in Select filter input? #1951

Closed
atiabjobayer opened this issue Oct 6, 2024 · 6 comments
Closed

Can we do AJAX search in Select filter input? #1951

atiabjobayer opened this issue Oct 6, 2024 · 6 comments

Comments

@atiabjobayer
Copy link

The current documentation mentions about dynamically putting the options, but there is no way to get the text in the search input box, which is essential to populate the result.

@atiabjobayer
Copy link
Author

@olton could you confirm me on this?

@MenesesEvandro
Copy link
Contributor

Please, take a look at this: #1967

If approved, it will allow you load a JSON into the select.

I’m cooking search from remote source… Maybe next week I’ll be able to send the pull to approval.

@olton
Copy link
Owner

olton commented Jan 31, 2025

Please, take a look at this: #1967

If approved, it will allow you load a JSON into the select.

I’m cooking search from remote source… Maybe next week I’ll be able to send the pull to approval.

I have some comments about the code, I'll try to provide a review today.

@MenesesEvandro
Copy link
Contributor

@olton

I’m trying to fetch only what’s typed by user.

I got a very big select to show (about 980k lines).

We are considering dynamically generated JSON.

So user will type something, let’s say, the name of the person. Then the fetch process fetch only the matched name.

I’m thinking adding 2 new options :

fetchOnType
If true will only fetch the JSON for the matching variables.

minFetchLenght
The minimum characters user must type before fetch starts.

Also, creating a new function…

_fetchAndLoad to handle this news attributes.

I do believe it’s a great addition for the framework.

Will do my best (but JS it’s not my best quality, as you can confirm with my last pull, but I do things work)

Best regards.

Evandro

@MenesesEvandro
Copy link
Contributor

Code ready for review...

I've created a new pull #1968 for @olton's revision

It's a little long code...

Please take your time to review it. I look forward to your feedback.

@olton
Copy link
Owner

olton commented Feb 3, 2025

@olton olton closed this as completed Feb 3, 2025
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

3 participants