I have datepicker, dropdown and text elements on my page and I want to fetch data from the database and show them in those elements. I could do it in the text elements successfully but I am not able to show the value on datepicker and dropdown,
Following code is within the $w.onReady( function ()
Note: I set the the ’ Show initial text ’ to ‘Nothing’ / ‘None’ for datepicker and dropdown from it’s settings. I am not using a dataset.
rptEditBuyDate - Datepicker
rptEditName - Dropdown
rptEditQty - Text Input
$w("#rptEditStock").onItemReady(($item, itemData, index) => {
$item("#rptEditBuyDate").date= itemData.bDate.toLocaleDateString();
$item("#rptEditName").value = itemData.bName.toString();
$item("#rptEditQty").value = itemData.bQuantity.toString();
$w("#rptEditStock").show()
$w("#rptEditStock").expand()
console.log(itemData.bRateOfCommission.toString())
})
In rptEditName (dropdown) I want to keep, whatever the value that comes from the above code, on top of the dropdown list and add more items from another database. How can I do that.
Thank you.