|
|
@ -1773,7 +1773,7 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){ |
|
|
|
tr.remove(); |
|
|
|
tr.remove(); |
|
|
|
that.scrollPatch(); |
|
|
|
that.scrollPatch(); |
|
|
|
} |
|
|
|
} |
|
|
|
,update: function(fields){ //修改行数据
|
|
|
|
,update: function(fields, related){ //修改行数据
|
|
|
|
fields = fields || {}; |
|
|
|
fields = fields || {}; |
|
|
|
layui.each(fields, function(key, value){ |
|
|
|
layui.each(fields, function(key, value){ |
|
|
|
var td = tr.children('td[data-field="'+ key +'"]'); |
|
|
|
var td = tr.children('td[data-field="'+ key +'"]'); |
|
|
@ -1782,8 +1782,7 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){ |
|
|
|
// 更新缓存中的数据
|
|
|
|
// 更新缓存中的数据
|
|
|
|
if(key in data) data[key] = value; |
|
|
|
if(key in data) data[key] = value; |
|
|
|
|
|
|
|
|
|
|
|
// 更新相应列视
|
|
|
|
// 更新相应列视图
|
|
|
|
// 若要更新其它列与之有关的动态模板,直接采用 reloadData 方法
|
|
|
|
|
|
|
|
that.eachCols(function(i, item3){ |
|
|
|
that.eachCols(function(i, item3){ |
|
|
|
if(item3.field == key){ |
|
|
|
if(item3.field == key){ |
|
|
|
cell.html(parseTempData.call(that, { |
|
|
|
cell.html(parseTempData.call(that, { |
|
|
@ -1793,8 +1792,21 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){ |
|
|
|
})); |
|
|
|
})); |
|
|
|
td.data('content', value); |
|
|
|
td.data('content', value); |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 更新其他包含自定义模板且可能有所关联的列视图
|
|
|
|
|
|
|
|
else if(related && (item3.templet || item3.toolbar)){ |
|
|
|
|
|
|
|
var thisTd = tr.children('td[data-field="'+ (item3.field || i) +'"]'); |
|
|
|
|
|
|
|
var content = data[item3.field]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thisTd.children(ELEM_CELL).html(parseTempData.call(that, { |
|
|
|
|
|
|
|
item3: item3 |
|
|
|
|
|
|
|
,content: content |
|
|
|
|
|
|
|
,tplData: data |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
thisTd.data('content', content); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
that.renderForm(); |
|
|
|
that.renderForm(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, sets); |
|
|
|
}, sets); |
|
|
|