https://velo-ninja.editorx.io/code-ninja/blank-3
$w.onReady(()=> {
let options = $w("#dropdown11").options;
options.push({"label": "All", "value": ""});
options.push({"label": "Cars", "value": "Cars"});
options.push({"label": "Vans", "value": "Vans"});
console.log("My-Options: ", options);
$w('#testButton').onClick(()=>{
populate_Dropdown(options);
});
});
function populate_Dropdown(options) {console.log("Pupulation DropDown running...");
console.log("Placeholder before for dropdown11:",$w("#dropdown11").placeholder);
$w("#dropdown11").options = options;
$w("#dropdown11").selectedIndex=undefined;
$w("#dropdown11").placeholder="Category";
console.log("Placeholder after for dropdown11:",$w("#dropdown11").placeholder);
}
Take a look onto example …
What was the problem ?
Everything seems to run without any problem…
