解决方案:
validate: function (value) {
var data = $table.bootstrapTable('getData'),
index = $(this).parents('tr').data('index');
console.log(data[index]); // row data
}
source: function (value) {
var data = $table.bootstrapTable('getData'),
index = $(this).parents('tr').data('index');
console.log(data[index]); // row data
} 例子:
{
field: 'containerType',
align: 'center',
title: '箱型',
editable: {
type: 'select',
title: '箱型',
formatter: function (value) {
return getDescriptionByDict(emptyContainerTypeDict, value);
},
source: function () {
var data = $table.bootstrapTable('getData'),
index = $(this).parents('tr').data('index');
console.log(data[index]); // row data
var result = [];
$.each(emptyContainerTypeDict, function (key, value) {
result.push({value: value.dictValue, text: value.dictLabel});
});
return result;
}
}
}