【发布时间】:2016-03-25 14:39:54
【问题描述】:
我的部分循环画廊图片:
<div id="galleryimgs" class="row">
@foreach($images as $key => $value)
<div class="col-lg-2 col-md-4 col-xs-6 thumb">
<img class="img-responsive" src="{{ $value }}" alt="" style="margin-left: auto; margin-right: auto;">
<div class="galleryremovebutton">
<a href="/admin/offer/gallery/delete/{{ $offer->id }}/{{ $key }}" class="btn btn-danger" role="button">Izbrisi sliku</a>
</div>
</div>
@endforeach
</div>
我的 dropzone 完成事件:
Dropzone.options.myGalleryDropzone = {
paramName: "file", // The name that will be used to transfer the file
maxFilesize: 2, // MB
parallelUploads: 8,
complete: function (response) {
$.getJSON( "/admin/offers/reload-gallery/{{ $offer->id }}", function( data ) {
$("#galleryimgs").html(data);
});
}
};
我得到的回应如下:
{"images":{"30":"\/media\/30\/conversions\/gallerythumb.jpg","31":"\/media\/31\/conversions\/gallerythumb.jpg"},"offerid":"65"}
现在我需要用这个响应重新加载上面的部分循环......
有什么想法吗?
【问题讨论】:
标签: jquery ajax laravel-5.1 dropzone.js