【发布时间】:2018-10-04 17:08:14
【问题描述】:
我想合并这两个脚本。但不能让它工作。我真的在 jquery 部分苦苦挣扎。
这是我正在使用的脚本: https://docs.telerik.com/kendo-ui/controls/editors/upload/how-to/select-additional-metadata
我想将 jQuery 部分添加到该脚本中以使图像预览正常工作: https://docs.telerik.com/kendo-ui/controls/editors/upload/how-to/add-image-preview
<script>
$(document).ready(function() {
$("#files").kendoUpload({
async: {
saveUrl: "save",
removeUrl: "remove",
autoUpload: false
},
multiple: false,
select: function(e) {
var fileInfo = e.files[0];
var wrapper = this.wrapper;
setTimeout(function(){
addPreview(fileInfo, wrapper);
});
}
});
});
Combine these two--------------------------------------------------------
<script>
$(document).ready(function () {
$("#files").kendoUpload({
multiple: true,
async: {
saveUrl: "save",
removeUrl: "remove",
autoUpload: false
},
template: kendo.template($('#fileTemplate').html()),
select: onSelect,
upload: onUpload
});
});
如果有知识的人可以帮助我,那就太好了! :-)
非常感谢!
【问题讨论】:
-
你有多个设置为 false 和 true,我不相信你可以在一个脚本中同时拥有这两个