Disable page back

Hello,

I have a form and after submit the user navigates to the newly created page. I want to prevent the user from going back to the form after the page is created.

I’ve used reloadAll: true but it doesn’t work. What is the right format?

Doesn't work:
    // Navigate to Example
    app.router.navigate({
         name: 'wod', 
         params: {status: "example"},
         options: {
                  reloadAll: true,
                  clearPreviousHistory: true
          }
    });

Doesn't work:
// Navigate to Example
app.router.navigate({
     name: 'wod', 
      params: {status: "example"}
});
// Prevent going back, clear history
app.router.clearPreviousHistory();

There is a route parameter reloadCurrent, which replaces the current page. Details can be found at next page:

https://framework7.io/docs/routes.html#route-options

1 Like

Doesn’t seem to work for me either. I have the code below but I can still navigate back.

                // Navigate to Example
                app.router.navigate({
                    name: 'wod', 
                    params: {status: "example"},
                    options: {
                        reloadCurrent: true
                    }
                });

When I add reloadAll: true option to the route it works. But I don’t want this as default behaviour for this route because there are multiple ways to visit this page. I only want to disable history when you visit this page after the form is submitted.

Anyone?

Router Methods
router.navigate(url, options) Navigate to (load) new page

  • url string - url to navigate to
  • options - object with additional navigation properties (optional):
    • clearPreviousHistory (boolean) - previous pages history will be cleared after reloading/navigate to the specified route

or

<div class='page no-swipeback'>
  ...
</div>
add **no-swipeback** class after frm submit

Thanks for the alternative solution @pvtallulah!

But I found the right syntax for clearPreviousHistory on the forum and it also works.

app.views.current.router.navigate("/pr-overview/CUS",{clearPreviousHistory: true});