kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.36k stars 2.4k forks source link

showRemove=>false from fileActionSettings and setting of width from initialPreviewConfig not working #1828

Open lordrebs opened 1 year ago

lordrebs commented 1 year ago

Hi Kartik, thank you for all your widgets and plugins. I just want some help with this, anything wrong why my 'showRemove'=>false and 'width'=>'120px' not working?

[ 'attribute'=>'photo', 'value'=>'../photos/'.$model->photo, 'format' => ['image',['width'=>'100','height'=>'100']], 'type' => DetailView::INPUT_WIDGET, 'widgetOptions' => [ 'class' => \kartik\file\FileInput::class, 'options' => [ 'accept' => 'image/*', 'multiple'=>false, ], 'pluginOptions' => [ 'initialPreview'=>[ !empty($model->photo) ? Yii::$app->params['backendUrl']. '/photos/' .$model->photo : null, ], 'initialCaption'=>!empty($model->photo) ? $model->photo : false, 'initialPreviewConfig' => [ [ 'caption' => $model->photo, 'width' => '120px', ], ], 'allowedFileTypes' => ['image'], // allow only images 'initialPreviewAsData'=>true, 'showUpload' => false, 'showRemove' => true, 'showCancel' => false, 'browseLabel' => '', 'removeLabel' => '', 'mainClass' => 'input-group-sm', 'bytesToKB' => 1024, 'sizeUnits' => ['B', 'KB', 'MB'], 'maxFileSize'=>2000, //2mb 'fileActionSettings'=>[ 'showZoom' => true, 'showRotate' => false, 'showRemove' => false, ] ] ] ],

lordrebs commented 1 year ago

Sorry, this was answered already! Thanks again!