I have a multi view(5 tabs)app.
I want to be able to load a subpage from a Url so Im trying to get pushstate to work in V5.
I want to be able to load an url like https://mydomain.com/omoss/1234
and that should load omoss
and send the id=1234
to that page.
In my index page I load the “shop.asp” page as my startpage.
But when I set pushStateOnLoad: true
in the view as below, the “shop.asp” is not loading and no other links work? So in order to be able to load the shop.asp page I have to set pushStateOnLoad: false
and I guess thats not right?
I did a test with the kitchenzink and there I got everything to work as it should, so I don´t understand why it is not working in my real project!!
I set pushstate in the view like this.
view: {
pushState: true,
pushStateSeparator: '',
pushStateOnLoad: false,
passRouteParamsToRequest : true,
passRouteQueryToRequest : true
},
And in my routes I have this.
{
name: 'omoss',
path: '/omoss/:id', //if I add :id here it is not loading the page at all
url: 'textsidor/omoss.asp',
options: {
animate: true,
ignoreCache:true,
},
},
And my view is this.
var mainView = app.views.create('.view-main', {
name:'mainView',
url: '/shop/',
});
If I use a link like https://mydomain.com/omoss/1234 I get an error and the url shows https://mydomain.com/omoss/textsidor/omoss/1234
I have tested so many different things now so I don´t know what else I can try.
Since I have a multi view app, do I have to have pushState: true
, in my
app.views.create
and not in the “view” as I have it above perhaps?
So what am I missing?
Any input really appreciated, thanks!