开发者

History 'hashchange' is not fired in Sencha

I am using Ext Sencha framework for the following scenario:

Ext.History.init()
Ext.History.on('change', function() { alert('zomg change!!11') }
Ext.History.add('zomg开发者_StackOverflow-token')

However the code above does not work in a HTML5-compliant browser (tested on Chromium) due to the following check in the .add() method:

add: function(token) {
    window.location.hash = this.setToken(token);

    if (!Ext.supports.History) { // <- this prevents the firing off of the event
        this.onChange();
    }
}

I just wonder whether there's any rationale behind it, since there seems to be no method in History class which wraps around native 'hashchanged' event binding.

I would like to avoid having to use the native APIs directly and rather have it nicely wrapped around with some lib, which provides working degradation for HTML4 browsers, but currently this does not seem to be the case with Sencha framework.

Please let me know if you know how to make it work.


It looks like I was using some beta version of the framework, build with incomplete support for history. Currently both v1 and v2 developer preview 4 seem to work just fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜