我不能删除从项目框中上传图标。我想上传当我点击“发送”按钮,所有图像。谢谢
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");
});
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"
写它。我会工作太!
<script>
$("#images").fileinput({
fileActionSettings: {
showUpload: false,
});
</script>
解
我加入这个
.kv-file-upload{
color:#fff !important;
visibility: hidden !important;
}
在backend\assets\css\colors.css
用更好的:
fileActionSettings: {
showRemove: true,
showUpload: false, //This remove the upload button
showZoom: true,
showDrag: false
},