Search in BelongsToSelect

Is it possible to search in a BelongsToSelect input to find a title faster ? I saw that we can do it in a dropdown with static values, maybe it’s possible to use it dinamically ?

Hello @PierreGaladrim,

Can you give a bit of context regarding the BelongsToSelect usage.
Where do you use it?

Thank you,

I need to link an article by title to my numero and my list in select is quite long. I want to allow the search in this field !

Hello @PierreGaladrim,

Can you tell me exactly what you are trying to achieve?
Are you creating a smart action with form?

A bit of code could be great too :tada:

Thank you,

Sure,

I have a component Numero with some articles linked. To choose these articles linked I use a foreign key to my Article component. Then I display Articles by title in a input belongsToSelect when I add a Numero.
But the select is a bit long. I want to allow the search in that field.

I didn’t use smart field for the moment but maybe you have a better solution with it ?

Is the Searchable Dropdown Edit widget what you are looking for?

Maybe but can I send my article titles as dropdown values using smart views ?

Are you using a smart view?

For the moment I don’t using smart views

I think I’m missing something here.
Is your question about smart view decorrelated from your original issue?

Yeah I just ask if I can fix my problem using smart views ?

You can do whatever you want by creating a smart view.
If switching to a Searchable Dropdown Edit Widget does not work, you can indeed try this solution :slight_smile:

Ok so how can I used data in database as values in dropdown using smart views ?

I suggest you to read the documentation on how to create and manage smart views.
It will help you understand what you can achieve.

If you have questions about smart views, please open a new issue :slight_smile:

@PierreGaladrim short answer is yes.

If your dropdown is referencing your articles, then you simply have to change the reference fields of your articles table to “Title”, to see the titles in the dropdown menu.

See how to change a reference fields

The problem is not to see them, I want to use my keyboard to find my title quicker !

Using our dropdown widget with SEARCH enable the experience should looks like this:

See GIF

Is this what you’re looking for?

1 Like

Yeah exactly thank you very much !

1 Like

You are more than welcome!

1 Like