Closed strtob closed 2 years ago
Yes - it should work with that. What is the issue you are facing?
Hi Kartik,
Thanks for your help!
This is my code:
[<?=
\kartik\widgets\FileInput::widget([
'name' => 'files[]',
'id' => 'upload',
'options' => [
'multiple' => true,
],
'pluginOptions' => [
'theme' => 'explorer',
'initialPreview' => false,
'initialPreviewConfig' => false,
'showUploadedThumbs' => false,
'overwriteInitial' => true,
'initialPreviewAsData' => true,
'deleteUrl' => false,
'previewFileType' => ['any',
'showUpload' => true,
'showRemove' => false,
],
'uploadUrl' => \yii\helpers\Url::to(['file/upload']),
'msgUploadBegin' => Yii::t('app', 'Please wait, system is uploading the files'),
'msgUploadThreshold' => Yii::t('app', 'Please wait, system is uploading the files'),
'msgUploadEnd' => Yii::t('app', 'Done'),
'dropZoneClickTitle' => '',
'uploadAsync' => true,
'browseOnZoneClick' => true,
'fileActionSettings' => [
'showZoom' => true,
'showRemove' => false,
'showUpload' => true,
],
'maxFileCount' => 20, 'maxFileSize' => 999999999, 'msgPlaceholder' => Yii::t('app', 'Select attachments'),
'uploadExtraData' => [
// config for relation
// 'relatedTable' => 'FileHasBankAccount',
// 'relationName' => 'fileHasBankAccounts',
// 'relatedTableField' => 'tbl_bank_account_id',
// 'relatedId' => $model->id,
],
//
],
'pluginEvents' => [
'filebatchselected' => 'function() {
$(this).fileinput("upload");
}',
'fileuploaded' => 'function(event, previewId, index, fileId) {
$.pjax.reload({container: "#kv-pjax-container", async: "false", timeout: "3000"});
}',
],
]);
?> ](![sc](https://user-images.githubusercontent.com/9219549/151127126-9b96b357-a0cb-4a73-b9d8-5ba2fba4dc07.png))
Yes... looks ok... can you select files to see if the theme is working fine as per explorer format.
your plugin work's fine! ...after the upload, the files disappear - the process was so fast that it was not possible to see the explorer view
Hi,
Are themes also available in yii2 file input?
I've tried with
without success and couldn't find something in the docu or web.
Thanks a lot!
Toby