取消对项目引导的FileInput上传按钮

问题描述 投票:0回答:4

我不能删除从项目框中上传图标。我想上传当我点击“发送”按钮,所有图像。谢谢

enter image description here

var btns = '<input type="hidden" id= "<?= $csrf['name'] ?>" name="<?= $csrf['name'] ?>" value="<?= $csrf['hash'] ?>">';
    $("#images").fileinput({
        uploadExtraData: {<?= $csrf['name'] ?>: "<?= $csrf['hash'] ?>", id_specie: "<?= $specie[0]['id_specie'] ?>"},
        deleteExtraData: {<?= $csrf['name'] ?>: "<?= $csrf['hash'] ?>", id_specie: "<?= $specie[0]['id_specie'] ?>"},
        initialPreview: <?= $immagini ?>,
        initialPreviewConfig: <?= $galleria_immagini ?>,
        initialPreviewAsData: true,
        showCaption: true,
        showUpload: false,
        showRemove: false,
        previewFileType: "image",
        removeLabel: "Elimina",
        uploadLabel: "Carica",
        overwriteInitial: false,
        maxFileSize: 10240,
        uploadUrl: '<?= base_url() ?>specie/do_upload',
        initialCaption: "Carica le immagini",
        uploadAsync: true,
        maxFileCount: 10,
        allowedFileExtensions: ['png', 'jpg' ]
    });



      $("#send").click(function () {
//            $("#images").fileinput({'uploadUrl': '<?= base_url() ?>specie/do_upload'});

    $("#images").fileinput("upload");

    });
jquery bootstrap-4
4个回答
1
投票
language: 'en',
showCaption: true,
showPreview: true,
showRemove: true,
showUpload: false, // <------ just set this from true to false
showCancel: true,
showUploadedThumbs: true

如果不低于尝试工作: -

你可以做一个简单的方法也只是在一个属性data-show-upload="false"写它。我会工作太!


0
投票
<script>
    $("#images").fileinput({
            fileActionSettings: {
                showUpload: false,
            });
</script>

0
投票

我加入这个

.kv-file-upload{
    color:#fff !important;
    visibility: hidden !important;
}

backend\assets\css\colors.css


0
投票

用更好的:

fileActionSettings: {
    showRemove: true,
    showUpload: false, //This remove the upload button
    showZoom: true,
    showDrag: false
},
© www.soinside.com 2019 - 2024. All rights reserved.