Hello. I am trying to dynamically populate dropdown column options in a data table in Public Web Forms.
I have followed the guidance in your documentation here: DataTable — Public web forms
function populateColumn(widget, value) {
widget.setDataSource({
data: ['Category A', 'Category B', 'Category C']
});
//set value if one was select
widget.value(value);
}
fd.control('Control1').$on('edit', function(e) {
if (e.column.field === 'Column1') {
//pass widget + current column value
populateColumn(e.widget, e.model.Column1);
}
})
This code works great when in desktop mode. However, on mobile, it fails when editing a record in the popup editor.
The problem is that the object 'e' passed in the 'onEdit' action in the popup editor does not contain either the 'column' or 'widget' properties. There is a 'model' property holding the data, and a 'container' property that seems like a complicated kendoUI thing. I have tried spelunking in this, but have not been able to work out a solution on my own.
Is there a way to target the widget and set options for a particular field when in the popup editor? Or can you suggest another way to accomplish this?
Thanks in advance!