0
我使用这个图片选择器jQuery插件(http://rvera.github.io/image-picker/),我面临着以下问题:重新填充图片选择器来选择控制与Ajax调用后,新的数据
Ajax调用后,重新填充用新数据选择控制。
$.ajax({
type: "GET",
url: requestURL,
dataType: 'json',
success: function(result)
{
$.each(result, function(i, obj) {
console.log(obj.description);
$('#cake-filling-types-select')
.append($("<option data-img-src='" + obj.image + "'></option>")
.attr("value", obj.code)
.text(obj.description));
});
$("#cake-filling-types-select").imagepicker({
show_label : true
});
$("#cake-filling-types-select").data("picker").sync_picker_with_select();
}});
欲了解更多详情,请在这里找到问题:https://github.com/rvera/image-picker/issues/79
感谢。