Hi. I have a virtual table with linked field (category):
function plant_next(item) {
var selected = task.categories.selections;
if (!selected.length) {
selected.add(task.categories.id.value);
}
item.server('plant_suggestions',[selected], function(result, err) {
if (err) {
item.alert('Failed to send the mail: ' + err);
}
else {
// Load suggestions into a temporary dataset for the modal
var modal = task.newplanting;
modal.open({ open_empty: true }, function() {
modal.disable_controls(); // avoid event firing during fill
for (var i = 0; i < result.length; i++) {
modal.append();
modal.id.value = i;
modal.category.value = result[i].plant;
modal.plant.value = result[i].plant;
modal.name.value = result[i].name;
modal.rank.value = result[i].rank;
modal.post();
}
modal.enable_controls();
modal.edit_options.multiselect = true; // allow selecting multiple plants
});
modal.view();
}
});
}
For some reason, the Category field does not display the category name. However, when I edit the category field, it does display. What am I doing wrong?