原代码:
function initSuffix($tbody) {
$tbody.find('>tr').each(function(i){
$(':input, a.btnLook', this).each(function(){
var $this = $(this), name = $this.attr('name'), val = $this.val();
if (name) $this.attr('name', name.replaceSuffix(i));
var lookupGroup = $this.attr('lookupGroup');
if (lookupGroup) {$this.attr('lookupGroup', lookupGroup.replaceSuffix(i));}
var suffix = $this.attr("suffix");
if (suffix) {$this.attr('suffix', suffix.replaceSuffix(i));}
if (val && val.indexOf("#index#") >= 0) $this.val(val.replace('#index#',i+1));
});
});
}
修正的代码:
function initSuffix($tbody) {
$tbody.find('>tr').each(function(i){
$(':input, a.btnLook, a.btnAttach', this).each(function(){
var $this = $(this), name = $this.attr('name'), val = $this.val();
if (name) $this.attr('name', name.replaceSuffix(i));
var lookupGroup = $this.attr('lookupGroup');
if (lookupGroup) {$this.attr('lookupGroup', lookupGroup.replaceSuffix(i));}
var suffix = $this.attr("suffix");
if (suffix) {$this.attr('suffix', suffix.replaceSuffix(i));}
if (val && val.indexOf("#index#") >= 0) $this.val(val.replace('#index#',i+1));
});
});
}
请注意红色代码部分,更改前查找带回数据不能正常显示.