Questions tagged as 'select2'

2
answers

two-way bind with Select2 in aurelia.io

Question How to implement a two-way link of an object to a VM in aurelia.io without losing the functionality of Select2 and maintaining the full link of the original, and also changes in the VM see reflected in the Select2 . Context...
asked by 03.12.2015 / 02:53
2
answers

How do I place the optgroup text before the option when selecting it with select2?

What I intend to do is that when selecting one of the options, put the parent text (optgroup) and show me something like " LG / Lg - Test 1 " (notece in the example that I say that "LG" is the parent (optgroup) and "Lg - Test 1" is the child (op...
asked by 09.05.2017 / 20:56
3
answers

Select2 jquery remove message "please enter 1 or more characters in select2"

I want to remove that message, any form? Here the html: Here the jquery:     
asked by 13.06.2016 / 17:33
1
answer

Fill a select in Laravel

I have a problem trying to fill a select with data from the database, with laravel 5.6 In my controller I have the following code: public function index() { $roles=roleUser::pluck('id_role','nombre'); return view('auth.register',co...
asked by 04.05.2018 / 03:27
1
answer

How do I use the ajax mode of select2 with optgroup and option?

Following the documentation I try the following: var data = { "results": [ { "text": "Life Good", "children": "[{\"id\" : 1, \"text\" : \"Lg Prueba 1\", \"element\" : \"HTMLOptionElement\"}, {\"id\" : 2, \"text\"...
asked by 09.05.2017 / 10:09
1
answer

How to make a custom select2 as it appears in the API of the same plugin?

I can not find how to customize my select2 as they do in the API. ( here the link ). I search everywhere and in the same Pligin API they do not specify anything of how to do it. I clarify that I do it in my system but in a simple way....
asked by 26.02.2017 / 17:46
4
answers

Loses the css after refreshing datatable

I have a datatable in which in a column there is a select2 , this select2 I have assigned a color according to the selected value, for it to bring me the data of that column I call a function that checks according to the id o...
asked by 22.12.2017 / 13:41
1
answer

Refresh Select2 Jquery

I have a simple select2: <select id="material" class="form-control select2 select2-hidden-accessible" style="width: 100%;" aria-hidden="true"> <option value="1">PC</option> <option value="2">Raton</option>...
asked by 07.03.2017 / 10:39
4
answers

perform a single function jquery once?

I have this function, function llenarcombos() { $.post("/Oficina/OficinaGeneral", function (data) { $.each(data, function (i, item) { $('#Ecbooficinageneral').append('<option value="' +...
asked by 01.08.2018 / 17:16
2
answers

How to insert the id of the data? but to show me the name in the select2

In the select I already show the name of the data 'json', but I want to send to the db its id. <section class="col col-6"> <label class="label"> Nombre </label> <select name="room_id" id="room_id" class="form-control...
asked by 09.03.2017 / 21:00