Hi,
I am surprised how difficult it is to have that simple task performed.
I have a table connected to a dataset connected to a collection. Selecting a row in the table loads the item fields in entry fields (not connected to data, but connecting them does not change the behaviour) and allows to change item contents. A submit button replaces the values in the table (it does) and should update the collection, but it doesn't despite a $w('#dataset').save()
"Import wixUsers" is declared, the dataset has the R/W enabled, the user is recognized as a "member" who has the write, update and delete rights assigned in the roles screen for that collection.
Inserting a new item with wixData.insert does not work either, even if the dataset is set to "write only".
Both insert and update work fine in preview, but not in live.
I am really surprised that 3 bound elements do not keep syncronized more easily... did I miss something ?
Webpage :
I can see that you insert your item to the database, but there is no code for dataset refresh:
let toInsert = { 'dateHeure': dt_finale, 'heure': (tH + ':' + tM), 'equipe': $w('#input1').value, 'championnat': $w('#input2').value, 'batBattu': $w('#input3').value, 'advLieu': $w('#input4').value, 'score': $w('#input5').value}; wixData.insert('match', toInsert) .then( (results) => { let item = results; console.log(results); $w('#dataset1').refresh(); } ) .catch( (err) => { let errMsg = err; console.log(errMsg); } ); } }
As far as I understand, you need to submit an item to the database and refresh your table? Try this: - submit to the database using wixData.insert() (https://www.wix.com/corvid/reference/wix-data.html#insert) - refresh your dataset (https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#refresh)