-
Notifications
You must be signed in to change notification settings - Fork 140
How to preload picture images into the plugin? #135
Comments
Hi, khmerlove, are you still need a solution? |
please share with us |
Hello @cresusjpt! foreach ($model->getGalleryPhotos()->orderBy(['id' => SORT_DESC])->all() as $photo) : Second on document load I moved these photos into widget container and deleted hidden: $(document).ready(function(){ And here you can see widget settings for my case: echo FileUploadUI::widget([ |
thank you, i'll try it and get back to you if i need more explication.
Le ven. 31 août 2018 à 10:57, Alexey POZHIDAEV <[email protected]> a
écrit :
… Hello @cresusjpt <https://github.com/cresusjpt>!
Six months ago I did it this way:
*First* I renderd existing photos in the hidden container
`
getGalleryPhotos()->orderBy(['id' => SORT_DESC])->all() as $photo) : ?>
fileName ?>
formatter->asShortSize(filesize($model->originalsDirectory .
$photo->fileName), 2)?> Delete
` **Second** on document load I moved these photos into widget container
and deleted the hidden one: ` $(document).ready(function(){ var
$existingPhotos = $(".existing-photos .files");
$("#room-uploadedphotos-fileupload .files").html($existingPhotos.html());
$(".existing-photos").remove(); }); ` And here you can see widget settings
for my case: ` $model, 'attribute' => 'uploadedPhotos', 'url' =>
Url::toRoute(['photos-upload', 'id' => $model->id]), 'gallery' => false,
'fieldOptions' => [ 'accept' => 'image/*' ], 'clientOptions' => [
'maxFileSize' => 2000000, 'prependFiles' => true, 'dataType' => 'json' ],
'clientEvents' => [ 'fileuploaddone' => 'function(e, data) {
$(document).find(".existing-photos").remove(); var that =
$(this).data("blueimp-fileupload") || $(this).data("fileupload"),
getFilesFromResponse = data.getFilesFromResponse ||
that.options.getFilesFromResponse, files = getFilesFromResponse(data),
template, deferred;
template = that._renderDownload(files);
$(".files").html(template);
$(".files").find("tr.fade").addClass("in");
}',
'fileuploadfail' => 'function(e, data) {
}',
],
]);
?>
`
Please do not hesitate to contact me if you find any unclearness.
Have a nice day.
Alex.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYPmgo3HCevAB6bJ4hqNxzYWghYN4jPKks5uWPqSgaJpZM4RY6iM>
.
|
From Jquery File Upload plugin's html files I got this:
where in where get-files action:
|
I do not know how to preload images from an existing directory into the plugin ? Please help me!!!
The text was updated successfully, but these errors were encountered: