jquery-select2

Select2 not working in Jquery-Steps

末鹿安然 提交于 2021-01-27 02:10:18
问题 I installed Jquery-steps plugin and select2 plugin. I put select2 box inside the Wizard form (jquery-steps) and it doesn't work. The list values are not exported in . Outside the wizard select2 works fine. 回答1: I just had to set $('.class').select2(); AFTER $('#form').steps(); 来源: https://stackoverflow.com/questions/23038301/select2-not-working-in-jquery-steps

select2 with ajax post method

雨燕双飞 提交于 2021-01-26 03:21:46
问题 I am trying to use select2 with ajax loading. Here is my code: clonedTemplate.find('[id^=detailsPhaseFinanceMinor_]').select2({ placeholder: "Select", minimumInputLength: 1, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper type: 'POST', contentType: "application/json; charset=utf-8", url: "mapBasic.aspx/GetFinSys", dataType: 'json', data: function (term, page) { return "{'term':\"" + term + "\"}"; }, results: function (data, page) { // parse

select2 with ajax post method

亡梦爱人 提交于 2021-01-26 03:18:46
问题 I am trying to use select2 with ajax loading. Here is my code: clonedTemplate.find('[id^=detailsPhaseFinanceMinor_]').select2({ placeholder: "Select", minimumInputLength: 1, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper type: 'POST', contentType: "application/json; charset=utf-8", url: "mapBasic.aspx/GetFinSys", dataType: 'json', data: function (term, page) { return "{'term':\"" + term + "\"}"; }, results: function (data, page) { // parse

select2 with ajax post method

早过忘川 提交于 2021-01-26 03:18:37
问题 I am trying to use select2 with ajax loading. Here is my code: clonedTemplate.find('[id^=detailsPhaseFinanceMinor_]').select2({ placeholder: "Select", minimumInputLength: 1, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper type: 'POST', contentType: "application/json; charset=utf-8", url: "mapBasic.aspx/GetFinSys", dataType: 'json', data: function (term, page) { return "{'term':\"" + term + "\"}"; }, results: function (data, page) { // parse

Multiple select element using select2 does not work properly

情到浓时终转凉″ 提交于 2021-01-03 08:36:09
问题 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> element with unique ids and names. On both element I've also used select2. I was expecting the two would have initiated the same behavior hence the same jQuery code. The two did start the select2 but the later was not showing any option included in the <option> tags. It only shows the "No result found" message.

select2 keyboard issue on mobile

|▌冷眼眸甩不掉的悲伤 提交于 2020-12-31 05:51:30
问题 I have an issue with select2, when it is being used on mobile devices. On click, the virtual keyboard is shown. I tried using something like $('select').select2({ shouldFocusInput: function (instance) { // Attempt to detect touch devices var supportsTouchEvents = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); // Only devices which support touch events should be special cased if (!supportsTouchEvents) { return true; } // Never focus the input if search is disabled if

select2 keyboard issue on mobile

你。 提交于 2020-12-31 05:51:27
问题 I have an issue with select2, when it is being used on mobile devices. On click, the virtual keyboard is shown. I tried using something like $('select').select2({ shouldFocusInput: function (instance) { // Attempt to detect touch devices var supportsTouchEvents = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); // Only devices which support touch events should be special cased if (!supportsTouchEvents) { return true; } // Never focus the input if search is disabled if

How to add icon in select2?

怎甘沉沦 提交于 2020-12-29 12:05:49
问题 I using select2 version 4 I try like this : $("select02").select2({ placeholder: "<i class='fa fa-sitemap'></i>Branch name", }); But, it's not working Demo is like this : http://jsfiddle.net/fc1qevem/8/ Any solution to solve my problem? 回答1: Always read the reference/manual first! From the official select2 examples on their web site; function formatState (state) { if (!state.id) { return state.text; } var $state = $( '<span><img src="vendor/images/flags/' + state.element.value.toLowerCase() +

How to add icon in select2?

点点圈 提交于 2020-12-29 12:05:36
问题 I using select2 version 4 I try like this : $("select02").select2({ placeholder: "<i class='fa fa-sitemap'></i>Branch name", }); But, it's not working Demo is like this : http://jsfiddle.net/fc1qevem/8/ Any solution to solve my problem? 回答1: Always read the reference/manual first! From the official select2 examples on their web site; function formatState (state) { if (!state.id) { return state.text; } var $state = $( '<span><img src="vendor/images/flags/' + state.element.value.toLowerCase() +

How to add icon in select2?

点点圈 提交于 2020-12-29 12:00:16
问题 I using select2 version 4 I try like this : $("select02").select2({ placeholder: "<i class='fa fa-sitemap'></i>Branch name", }); But, it's not working Demo is like this : http://jsfiddle.net/fc1qevem/8/ Any solution to solve my problem? 回答1: Always read the reference/manual first! From the official select2 examples on their web site; function formatState (state) { if (!state.id) { return state.text; } var $state = $( '<span><img src="vendor/images/flags/' + state.element.value.toLowerCase() +