Open philbaney opened 6 years ago
Normally, you would display two forms here. First the form with the selection field and then the one with the dependent data source. Very roughly according to this pattern:
const config1 = {
"properties": {
"myProperty": ...
},
...
"form": {
"buttons": {
"submit": {
"click": function() {
const dataSource = "url?id=" + encodeUriComponent(this.getValue().myProperty);
const config2 = {
...
"dataSource": dataSource
};
$(...).alpaca(config2);
}
}
}
}
};
$(...).alpaca(config1);
Another possibility, which should not be possible without own network queries and the following changes of the configuration at runtime, would be the options tree: http://www.alpacajs.org/docs/fields/optiontree.html
I hope I could help you further...
I'm relatively new to Alpaca Forms, I have a form with several select lists loaded from data sources in a controller/view framework, this is working fine. How can I dynamically build a select's url e.g "dataSource":"url?id=Z" where Z is say an id from a previous 'select'?