mirror of https://github.com/layui/layui
update code
parent
e52c605fe1
commit
18d238e9f5
|
@ -1908,13 +1908,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
|||
var that = this;
|
||||
var ELEM_CELL = '.layui-table-cell';
|
||||
var opts = layui.type(opts) === 'array' ? opts : [opts];
|
||||
var dataCache = table.cache[that.key] || [];
|
||||
|
||||
var update = function(opt){
|
||||
var index = opt.index;
|
||||
var row = opt.row;
|
||||
var related = opt.related;
|
||||
|
||||
var dataCache = table.cache[that.key] || [];
|
||||
var data = dataCache[index] || {};
|
||||
var tr = that.layBody.find('tr[data-index="' + index + '"]');
|
||||
layui.each(row, function (key, value) {
|
||||
|
@ -1959,12 +1959,12 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
|||
}
|
||||
|
||||
layui.each(opts, function(i, opt){
|
||||
update(opt)
|
||||
update(opt);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新行
|
||||
* 更新指定行
|
||||
* @param {string} id - table ID
|
||||
* @param {updateRowOptions | updateRowOptions[]} options
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue