New to wix. Need help with deleting the data on dynamic page. I have a page showing user data from database collection (dynamic item page). I want to allow user to delete the data and get redirected to homepage. The delete button does not have the ‘when successful, navigate to x page’ function. When I used the link for the button, it does not seem to work when staying on the same page. Please help. Thanks!
You can use wixLocation to allow the button to navigate to whatever page you want. Telling it to navigate to “/” will redirect it to your homepage.
import wixLocation from 'wix-location';
export function button3_click(event) {
wixLocation.to("/")
}
the delete works but the redirection still does not work.
import wixLocation from ‘wix-location’;
$w.onReady( function () {
//TODO: write your page related code here…
});
export function button3_click(event) {
//Add your code for this event here:
wixLocation.to(“/home”)
}
Check the button properties and make sure you have an event handler “onClick”
(Mine says button2, but of course yours will be button3)
Worked! Thank you so much for your help!