我只是像这样使用我的代码
Dropzone.options.attachkyc = {
maxFiles: 1,
accept: function(file, done) {
console.log("uploaded");
done();
},
init: function() {
this.on("maxfilesexceeded", function(file){
alert("No more files please!");
});
},
addRemoveLinks: true,
removedfile: function(file) {
var name = file.name;
$.ajax({
type: 'POST',
url: host+'upload/unfile',
data: "id="+name,
dataType: 'html'
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
//console.log();
}
};
Run Code Online (Sandbox Code Playgroud)
当我上传第二个文件时,显示警报“请不再有文件!”,文件未上传的情况良好,但我的问题是,我添加的第二个文件仍然显示在我的拖放区中。我的问题是在显示警报后如何自动删除第二个文件?
知道如何使用columnDefs如下属性
var table = $('#myTable').DataTable( {
columnDefs: [
{ targets: [> 0], visible: true}
]
} );
Run Code Online (Sandbox Code Playgroud)
我可以这样做吗?
我需要定位除第一列之外的所有列。
我有这样的桌子
<table id="tbl_orderstatus" class="dataTable table table-bordered table-hover table-full-width nowrap" width="150%" data-table="tblorderstatus">
<thead>
<tr>
<th>Buyer</th>
<th>Season</th>
<th>Style#</th>
<th>KP#</th>
<th>Item Description</th>
<th>Buyer PO</th>
<th colspan="2">Qty</th>
<th>Material</th>
<th>Destination</th>
<th>Delivery Date</th>
</tr>
</thead>
</table>
Run Code Online (Sandbox Code Playgroud)
但我的问题是,我只是把<th colspan="2">Qty</th>那犯了错误,它说未捕获的样式未定义。我怎样才能像那样制作clospan?因为我需要在数量上放置 2 个数据列。
tq 作为答案,我打赌我必须在标题上使用两行。伙计们:)
我的拖放区有问题,
$(".js-example-basic-multiple").select2();
Dropzone.options.dropZone = {
//options here
maxFilesize: 2,
addRemoveLinks: true,
removedfile: function(file) {
var name = file.name;
$.ajax({
type: 'POST',
url: host+'upload/unfile',
data: "id="+name,
dataType: 'html'
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
//console.log();
},
init: function() {
this.on("maxfilesexceeded", function(file){
alert("No more files please!");
});
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,当文件上传失败时,它仍然显示预览图像,所以我需要在这些文件上传失败时自动删除该文件,我该怎么做?