Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lordrebs opened this issue Dec 23, 2022 · 1 comment

Comments

@lordrebs
Copy link

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
Copy link
Author

Sorry, this was answered already! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant