修复新版本对 table reload 造成影响的问题

pull/94/head v2.2.4
sentsin 2017-12-07 21:48:54 +08:00
parent 9ed17a7ef4
commit 4b63b64865
4 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

2
dist/layui.all.js vendored

File diff suppressed because one or more lines are too long

View File

@ -146,7 +146,7 @@ layui.use('upload', function(){
,auto: false ,auto: false
,bindAction: '#testListAction' ,bindAction: '#testListAction'
,choose: function(obj){ ,choose: function(obj){
var files = obj.pushFile(); //将每次选择的文件追加到文件队列 var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
//读取本地文件 //读取本地文件
obj.preview(function(index, file, result){ obj.preview(function(index, file, result){
@ -180,7 +180,7 @@ layui.use('upload', function(){
,tds = tr.children(); ,tds = tr.children();
tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>'); tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
tds.eq(3).html(''); //清空操作 tds.eq(3).html(''); //清空操作
delete files[index]; //删除文件队列已经上传成功的文件 delete this.files[index]; //删除文件队列已经上传成功的文件
return; return;
} }
this.error(index, upload); this.error(index, upload);

View File

@ -1246,6 +1246,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
thisTable.config = {}; thisTable.config = {};
table.reload = function(id, options){ table.reload = function(id, options){
var config = thisTable.config[id]; var config = thisTable.config[id];
options = options || {};
if(!config) return hint.error('The ID option was not found in the table instance'); if(!config) return hint.error('The ID option was not found in the table instance');
if(options.data && options.data.constructor === Array) delete config.data; if(options.data && options.data.constructor === Array) delete config.data;
return table.render($.extend(true, {}, config, options)); return table.render($.extend(true, {}, config, options));