开发者

ExtJs Back Fwd Buttons

In the past I have developed large extjs single page applications. Many users get frustrated for not being able to use the Back or Fwd buttons or reload the page.I would also like to warn the user if they navigate away from a page without completing a work flow, and enable users to directly access particular views.

For the next application, I am thinking of using the Codeignite开发者_开发技巧r php MVC framework. It is possible to something similar to this example. I am stucked thinking about the navigation. If I load the ExtJs for each view, that is a significant slowdown. How best to approach this?


Have a look at the Ext.History class (Ext.util.History on Ext4). With it you can register listeners for changes to the hash:

Ext.History.on('change', function( token ) {
    console.log('token changed to: ', token);
});

The Ext.History singleton includes forward() and back() methods for triggering navigation from within the client-side code.

By having only the hash part of the URL change the browser stays on the same page, thus eliminating the need to reload the Ext library.

How this would integrate with your PHP framework I cannot say. I am not familiar with CodeIgniter and your example link goes to a dead page.

Also, do note a caveat with History in that under Ext3 at least it may give you issues with newer browsers. If this is the case an alternative is to code your own History-like solution using the 'hashchange' browser event as illustrated in this answer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜