Last active
July 12, 2022 00:49
-
-
Save carloswm85/6e45ac72dadb668d608f0e1e2da748d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
// Variable assignment | |
var $producerSelect = $('#ProducersId'); | |
$producerSelect.on('select2:select', function (e) { | |
var data = e.params.data; | |
var idPerson = data.id; | |
var dataWrapper = { | |
idPerson: idPerson | |
} | |
$fileSelect.select2({ | |
language: "es", | |
theme: "bootstrap-5", | |
placeholder: { | |
id: '0', | |
text: 'Seleccionar opción' | |
}, | |
allowClear: true, | |
width: 'style' | |
}); | |
$.ajax({ | |
url: '/Checkbook/GetFileList', | |
dataType: "json", | |
async: true, | |
data: dataWrapper, | |
method: "POST", | |
success: function (response) { | |
var tempList = `<option value="${0}" name="${"NN"}" class="custom-option">${"Seleccionar expediente"}</option>`; | |
for (i = 0; i < response.length; i++) { | |
tempList += `<option value="${response[i].IdFile}" title="${response[i].ClaimName}" class="custom-option">${response[i].FileNumber}</option>`; | |
} | |
$fileSelect.empty(); | |
$fileSelect.html(tempList); | |
$claimName.val("Selección automática"); | |
}, | |
error: function (ex) { | |
console.error(ex.responseText); | |
} | |
}); | |
$fileSelect.prop("disabled", false); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment