私のスクリプトは次のとおりです。$.getJSON()で PersonListを取得 し、Jquery-chosen を使用して PersonList 内のすべての要素を並べて表示したいと考えています。ただし、最後の項目のみが表示されます。
助けてくれてありがとう。
$(document).ready(function () {
$("#raporNo").on('change', function () {
var yId = $(this).val();
$.getJSON("../Ekranlar/GorevlendirilenAdliBilUzmanlariGetir", { xId: yId },
function (PersonList) {
$("#chosenDropDown2").empty();
$.each(PersonList, function (index, itemData) {
$("#chosenDropDown2").append("<option>" + itemData.Text + "</option>");
$("#chosenDropDown2").val(itemData.Text);
$("#chosenDropDown2").trigger("chosen:updated");
});
});
});
});