{"visible":true,"field":"remarks","title":"备注","formatter":function(value, row, index, field) {
if(value === 'undefined' || value =='null' || value ==null){
value=''
}
// 专线
if(row.ls == "2"){
return '<input style="width: 100%;" type=\"text\" rowId=\"'+row.id+'\" index=\"'+index+'\" field=\"remarks\" class="tableInput" value=\"'+value+'\" name=\"remarks'+row.id+'\" id=\"remarks'+row.id+'\"/>';
}else{
return sc1(value,row,index);
}
},events: {'change .remarks': function (e, value, row, index) {
// 获取当前选中的值
var selectedValue = $(this).children('option:selected').val();
// 更新value
$('#specialLineTable').bootstrapTable('updateCell', {
'index': index,
'field': 'remarks',
'value': selectedValue,
'reinit': false
});
// 保存列表数据
saveGroupLineInfos();
}}},
function sc1(value,row,index) {
var str = '<select style="width: 100%" rowId="'+ row.id + '" index="' + index + '" id="remarks' + row.id + '" name="remarks' + row.id + '" field="remarks" class="remarks">';
str += '<option value="" selected>请选择</option>';
if (row.remarks == '1') {
str += '<option value="1" selected>汇聚端</option>';
}else{
str += '<option value="1">汇聚端</option>';
}
if (row.remarks == '2') {
str += '<option value="2" selected>纯购置</option></select>';
}else{
str += '<option value="2">纯购置</option></select>';
}
return str;
}
events绑定change事件