Answer the question
In order to leave comments, you need to log in
data-* attributes in select2?
There is a code:
$('.itemName').select2({
placeholder: 'Введите перенесенные болезни, можно вводить название или код МКБ',
ajax: {
url: "{{route('getRequestmkb10')}}",
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.value+' :: '+item.text,
id: item.id,
title: item.value,
disease: item.text
}
// alert(item.id);
})
};
},
cache: true
}
});
<select id="cn_ds" class="itemName form-control" style="width:100%;" name="f_sickness[]" value="{{old('f_sickness')}}" multiple data-ajax--disease=""></select>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question