I have a user CV database. Categories are displayed in the multiplier. It gives the possibility of editing a CV, but this is done to see the changes I need to refresh the page. Why do not the data change automatically like when they are displayed in the table?
Dear Thomas
First of all you will need to provide more information, images, code where something goes wrong. Please read this post https://www.wix.com/code/home/forum/community-discussion/wix-code-forum-guidelines-for-posting-a-question and the edit your post so we can help you in the best way possible. We will do what we can to help you.
Hi Tomas,
If you write correctly the update() function your database should changes automatically.
Pay attention that you compare the _id property of the specified item with the _id property values of the items in the specified collection.
In order to get the current item’s id use the getCurrentItem( ) function.
$w("#myDataset").onReady( () => {
let itemObj = $w("#myDataset").getCurrentItem();
let toUpdate = {
"_id": itemObj._id,
"title": " ",
"first_name": " ",
"last_name": " "
};
wixData.update("myCollection", toUpdate)
.then(()=>{
$w("#myDataset").refresh()
})
}
For more information about Update() function:
wix-data - Velo API Reference - Wix.com.
For more information about getCurrentItem( ) function:
Dataset - Velo API Reference - Wix.com.
Have a nice day, and best of luck!
Sapir,