I’m accessing two datasets:
$w . onReady ( () => {
$w ( “#plantSaleEntries” ). onReady ( () => {
console . log ( “plantSaleEntries ready” );
});
$w ( “#plantSaleCounts” ). onReady ( () => {
console . log ( “plantSaleCounts ready” );
});
//Set dataset index to 0 - first index in collection
$w ( “#plantSaleCounts” ). setCurrentItemIndex ( 0 ); //Set to first index
$w ( “#errSlotFull” ). hide (); //Hide poss. previous error msg
});
I then access a dropdown to select a time slot then store values on the plantSalesCount dataset:
export function submit_click ( event ) {
console . log ( “Entered submit” );
$w ( “#plantSaleCounts” ). setFieldValue ( countsTime , countsVal );
console . log ( "countsTime, countsVal = " , countsTime , countsVal );
$w ( “#plantSaleCounts” ). save ();
This works perfectly in preview mode but in publish mode values are not updated in the plantSaleCounts database. I hope someone can spot the problem or give me a hint…
Thanks in advance.