You found a bug! We've classified it as
EXTJS-14877 .
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.Ext.app.BaseController redirectTo force bug
Ext.app.BaseController redirectTo force bug
I believe there is a bug in the method redirectTo found in Ext.app.BaseController. If you use "force", it will fire twice if the force is not necessary (i.e. the token is different). This bug is still present in the latest nightly. I'll make a fiddle if I find time, but it's pretty easy to see the issue just looking at the code.
Code:
redirectTo: function(token, force) {
if (token.isModel) {
token = token.toUrl();
}
if (!force) {
var currentToken = Ext.util.History.getToken();
if (currentToken === token) {
return false;
}
} else {
Ext.app.route.Router.onStateChange(token); Fires here
}
Ext.util.History.add(token); Fires again because the token changes
return true;
}
Something like this should fix it:Code:
redirectTo: function(token, force) {
if (token.isModel) {
token = token.toUrl();
}
var currentToken = Ext.util.History.getToken();
if (currentToken === token) {
if (force) {
Ext.app.route.Router.onStateChange(token);
}
else{
return false;
}
}
Ext.util.History.add(token);
return true;
}
Ext.app.BaseController redirectTo force bug
Aucun commentaire:
Enregistrer un commentaire