Home » Php » javascript – Multiple image upload issue

javascript – Multiple image upload issue

Posted by: admin February 25, 2020 Leave a comment


i am creating a multiple image uploader in yii2.
My file upload widget like below

<?=$form->field($model, 'file[]')->widget(FileInput::classname(), [
    'pluginOptions' => [
        'initialCaption'=>"The Moon and the Earth",
        'initialPreviewConfig' => [
            ['caption' => 'Moon.jpg', 'size' => '873727'],
            ['caption' => 'Earth.jpg', 'size' => '1287883'],
        'showCaption' => false,
        'showRemove' => false,
        'showUpload' => false,
        'showCancel' => false,
        'browseClass' => 'btn btn-theme btn-lg btn-block',
        'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ',
        'browseLabel' =>  'Select Photo',
    'options' => ['accept' => 'image/*','multiple'=>true]

And the out image given below
enter image description here

in image we can see that for the initial preview images there is move icon to move the image and we can arrange the position.But when i select another file it doesn’t have the move icon. How can i add move button to the newly selected files.Because i don’t want to set initial Images

How to&Answers: