Questions tagged [tom-select]
48 questions
4
votes
3 answers
change value of tom select after rendering it
I'm working on an update function that uses tom-select (https://tom-select.js.org/).
The process goes as follows:
1- the user clicks on the edit button
2- a bootstrap modal will open and the data of the selected row will show so he can update…

Mohammad Azzam
- 83
- 2
- 10
3
votes
1 answer
How to customize the placeholder text using the Tom Select Javascript UI
My goal is to change the font of the placeholder text in for the select fields for the dance styles and event types, both are using the Tom Select JS UI for the select dropdowns.
Through the Tom Select site I was able to find this:
.ts-wrapper…

Ogarocious
- 119
- 6
2
votes
1 answer
Hot to disabled the (not so)intelligent remote load caches in Tom-Select
I need to show different select lists on a tom-select depending on if the search box is empty or not.
But tom-select is not calling the load function if you remove all characters in the search box.
To make it a little bit clearer:
When you open the…

Thallius
- 2,482
- 2
- 18
- 36
2
votes
1 answer
Rails tom-select how to keep selected value in edit form?
I have a tom-select field works fine with an ajax search. When I select the record to edit the form it does not display any value of what was selected as the location. I am trying to set the default field but nothing has allowed me to have any value…

spacerobot
- 265
- 1
- 5
- 23
2
votes
1 answer
Rails 7 JavaScript event listeners stop working after browser back?
I have rails 7 app where I'm trying to build a search bar using either tom-select or slim-select. My issue reproduces no matter which library I'm using therefore it must be the issue on my rails side.
app/views/cities/index.html.erb
<%= form_for…

zdebyman
- 550
- 1
- 4
- 22
2
votes
2 answers
Tom-select with bootstrap 5 theme differs visually from bootstrap 5.1.3 styled select
Premise
In order to display selects the same on Windows, Linux and Mac, in my project, i am using combination of:
tom-select v2.0.1 JavaScript library;
Bootstrap v5.1.3 frontend framework;
Symfony v5.4.5 backend framework.
I have set up SCSS files…

Rikijs
- 728
- 1
- 12
- 48
2
votes
2 answers
Tom-Select (or Selectize.js) Remote data for Option Groups
I am trying to use remote data for tom-select (https://tom-select.js.org/examples/optgroups/). I am at a loss how to configure option groups with remote data. I have the select loading with remote data like this:
"optgroup": "1 Materials | 1.2…

Dan Tappin
- 2,692
- 3
- 37
- 77
1
vote
1 answer
Tom-select created record doesn't update the dropdown options (Rails / Stimulus)
I'm using tom-select in my rails app (with Stimulus) to create a 'Vendor' model record on the fly in order to then select it in the dropdown of my 'Trx' model. I can get the fetch request to create the record but my drop down does not update.…

chug
- 71
- 6
1
vote
0 answers
How to set default selected value in UX Symfony dropdown
I managed to implement dropdown with UX Symphony using custom Autocompleter following the documentation.
namespace App\Autocompleter;
class FooAutocompleter implements EntityAutocompleterInterface { ... }
I add this view :
1
vote
1 answer
How can I populate a select field in my form on render when the options are loaded by tom-select?
I have a form that, upon submit, will store its values in a session variable before redirecting to the same form, in order to repopulate it again with the same values. This works fine for the input fields, but my select fields have their options…

Mechanica
- 11
- 2
1
vote
1 answer
Symfony 5 - Override Form Type Options
The problem:
Hello, i am having a trouble with passing some options to the form fields in Symfony 5 Form Builder.
In the controller the form is being created:
$form = $this->createForm(FooFormType::class, $foo);
In the FooFormType.php my…

Kacper
- 56
- 7
1
vote
3 answers
How to disable the ability to search
Easiest question ever, I looked at the documentation but can't find the answer. Is there an option to disable the ability to search when clicking the select?
Thanks!

user2150463
- 35
- 5
1
vote
1 answer
How can I use Tomselect in an easyadmin filter
In easyadmin we can use the pretty cool Tomselect library in an entity crud form https://symfony.com/doc/current/EasyAdminBundle/fields/AssociationField.html
But how can I use this library in a filter?

skymeissner
- 228
- 1
- 9
1
vote
0 answers
Tom-Select options not loading while using JavaScript's native Fetch API in this example to retrieve remote data from a route
I am attempting to load tom-select options not loading while using JavaScript's native Fetch API in this example to retrieve remote data from a route. However, JS below fetches a json array of 15527 items but won't show on the options
The Select…

tinaobi
- 11
- 1
1
vote
1 answer
Placeholder when using minimum length
I'm using the shouldLoad functionality to set a minimum length of characters before data loads from a remote source, like the example here
shouldLoad:function(query){
if ( query.length < 3 ) return false;
return true;
},
Is there a way to…

David Hendrick
- 93
- 2
- 13