I am using jQuery select2 inside a modal... but its appearance is not right... u can see it in the below image... How to fix this ? Problem happens only inside modal.image
<div class="col">
<label class="control-label">Department*</label>
<select class="form-control select2" name="department_id">
<option value="" selected>Select Department</option>
@foreach ($departments as $value)
<option value="{{ $value->id }}">{{ $value->name }}</option>
@endforeach
</select>
</div>
Jquery used for modal,
function viewCreate() {
if (typeof device !== 'undefined')
device.abort();
device = $.ajax({
type: 'GET',
url: "devices/create/",
dataType: 'JSON',
async: true,
beforeSend: function () {
if (typeof device !== 'undefined')
device.abort();
},
success: function (response) {
$('#showData').html(response.data);
$('.showModal').modal('show');
}
});
}