jquery-select2-4 Questions

5

I have implemented select2 widget, version 4. It works, but the x icon. It is not clearing the selection. If you see this doc: https://select2.github.io/options.html, it says that this a problem i...
Lietuva asked 26/4, 2016 at 2:46

3

Solved

Following is my code: $('#cow_id_2').select2({ allowClear: true, placeholder: "Search a cow/dam ID", formatNoMatches: function (term) { return "<a href=/'http://google.com/'>Add</a&gt...
Sitra asked 13/6, 2016 at 19:22

15

Solved

I have a select2 v4.0.0 being populated from an Ajax array. If I set the val of the select2 I can see via javascript debugging that it has selected the correct item (#3 in my case), however this is...
Boulevardier asked 19/5, 2015 at 4:7

3

Solved

I am having an issue with select2 where after I enter an item and I want to use the same dropdown again, i can't seem to remove the previously selected item For example, lets say my id is "#Strea...
Hymanhymen asked 6/12, 2015 at 14:33

6

I'm using Select2JS 4.0.5 with PHP and jQuery 3.2.1. jQuery is included first, then right after that select2js then after that the rest of JS libraries. My code if ($("#company").length > 0){ /...
Retainer asked 15/2, 2018 at 11:51

3

Solved

I migrated from chosen to select2 plugin because it works better for me, but its documentation is very poor when compared to chosen. Could anyone tell me what option(s) should be used to make selec...
Blowhard asked 22/7, 2015 at 19:4

12

I want to add a button in first element of the list to "Add new item". If user clicks on that button I need to open a pop-up and get the input from users. How to do this in select2 plugin? Is any d...
Katti asked 28/7, 2016 at 12:2

8

Solved

In this example of data loaded from a remote source I can see images and other html elements rendered as options. I'd like to accomplish the same thing using data in a local array. I've tried build...
Seagraves asked 1/4, 2016 at 15:59

2

Solved

I have the following code (javascript): $('#cbxConnections').select2({ minimumInputLength: 0, multiple: false, allowClear: true, placeholder:{ text:"@Diccionario.Connections", id:" @Dicciona...
Orchidectomy asked 13/3, 2015 at 15:9

1

I am using Select2 within WooCommerce in some of my own custom areas and I am targeting it with some code to add and removes certain classes and it's working fine except for the SelectWoo instances...

7

I have a select2 box in bootstrap modal, I want to change the value of the select2 box but it didn't work. I tried every single solution in previous posts and results but none of them got it work....
Carbajal asked 4/8, 2016 at 16:43

3

Solved

I am trying to create a custom data adapter according to an example here: http://select2.github.io/announcements-4.0.html#query-to-data-adapter. How can I move the line that creates the select2 con...
Komarek asked 4/8, 2015 at 13:21

4

I attempted to use the "language.noMatches" option when initiating Select2 and its throwing an undefined function? How do I go about modifying that bit of text? I would like to include a html butto...
Fasano asked 27/3, 2015 at 17:32

7

I'm trying to load content from different html page to a popup then applying select2 on it. everything is working, but the z-index for the select2 is not correct, event if I modified it to bigger ...
Irrepressible asked 24/7, 2015 at 21:47

5

Solved

I have a project that uses Bootstrap 3.3.4, Select2 4.0, and Jquery Validation 1.13.1 I have set the jquery validator defaults to style bootstrap 3 classes like so $.validator.setDefaults({ err...

5

Solved

I've been trying out the new Select2 v4.0 which has a lot of improvements. I'm mainly interested in the tags feature. I want to be able to search for tags via ajax and only be able to select a tag ...
Symbolic asked 27/5, 2015 at 0:45

7

I've built a web-app using a Select2 search box, which connects to our backend via AJAX. The search box passes the query (say "APPLES") to the backend, which then updates the page. How do I program...
Risinger asked 28/5, 2015 at 21:8

8

I've a select2 dropdown which looks like this : $(function () { $("#itemSelect").select2().on("select2:select", function (e) { $("#itemSelect").val(-1).trigger("change"); var id = e.params.dat...
Tooley asked 19/2, 2016 at 8:20

17

Solved

I have a form with multiple text inputs and some select2 elements. Using the keyboard to tab between fields works fine - the Select2 element behaves like a form element and receives focus when tab...
Delenadeleon asked 8/1, 2014 at 7:29

2

Solved

How can I get hold on the <option> that was just selected when listening to the select2:select event? Note that this is simple when using a single-select, as when only one option is selected,...
Glebe asked 21/5, 2016 at 16:5

3

I am using the lastest version of Select2. Want to add an Insert New button at the end of the dropdown list. I tried these two solutions I found online Solution 1: $(".select2-drop").append('<...
Infinitive asked 11/2, 2016 at 14:56

3

Solved

Please note that this is not about <select> element with multiple attribute, but multiple <select>s in a form, which I haven't found asked here. See this codepen I have two <select...
Him asked 25/1, 2016 at 10:37

8

Solved

I am using select2 with custom data adapter. All of the data provided to select2 is generated locally in web page (so no need to use ajax). As query method can generate a lot of results (about 5k) ...
Epiphenomenon asked 24/9, 2015 at 8:24

4

I am currently unable to tab into a Select2 enabled <select> element in Firefox (38.0.5) - in other words, cannot access to select <option> in a mouseless manner. In Chrome, you can tab...
Shabbygenteel asked 3/6, 2015 at 21:19

9

Solved

I'm fetching user IDs and names via AJAX and using Select2 to search through them, but my users have requested the ability to select from the typeahead dropdown by pressing Tab, effectively treatin...
Allanallana asked 3/11, 2015 at 2:17

© 2022 - 2024 — McMap. All rights reserved.