Route page redirect not working

Hello,

How to create route page from ajax response success.

V1
mainView.router.loadPage(‘about.html’);

framework7 version1 perfect working but i was tried as per version 2 but not working route page.

Thank

Have you read v2 docs? You need to specify it in app/view routes http://framework7.io/docs/routes.html

Yes, i was specified as per route config but my question is “How to redirect when ajax response success”. as well as parameter pass.

Thanks

Hi @Subhash_Patel,

Try this.

awnicapp.router.navigate("/");

/ indicates your router path

{
    path: '/',
    url: './index.html'
}

thanks for reply @rajkaruna, how to assign parameter with route page as per first routing. Is it possible?

Hi @Subhash_Patel,

You can send data as part of router like below

{
    path: '/page2/',
    url: './page2.html',
	options: {
        context: {
          users: 'Rajkaruna',
		  forum:'Framework7'
        },
     }
} 

Or you can set your values to global context using app.data

app.data.userDet = { users: 'Rajkaruna', forum:'Framework7' }

2 Likes

Thanks @rajkaruna. Is it possible to same page data set with “app.data”.

Yes @Subhash_Patel

You can set data on context with any scope (inline page, redirect page) like sessionStorage.

It will persist until app reloaded.

1 Like

Thanks @rajkaruna for reply

Is it possible to replace content, when ajax response success after replace content. please help me.

how to replace this content, no idea about it.

Hi, how do I set up a route for my custom pages to work (CORE v5.7.12)?

I have been using Framework7 v.1 and I would to upgrade to the latest version but I can’t seem to make it to work. I need a sample code for a working custom routes and pages.
Thank you in advance!