ExtJs 后退按钮
过去我开发过大型 extjs 单页应用程序。许多用户因无法使用“后退”或“前进”按钮或重新加载页面而感到沮丧。如果用户在未完成工作流程的情况下导航离开页面,我还想警告用户,并使用户能够直接访问特定视图。
对于下一个应用程序,我正在考虑使用 Codeigniter php MVC 框架。可能会出现类似于此示例的情况。我一直在思考导航。如果我为每个视图加载 ExtJ,速度会显着下降。 如何最好地解决这个问题?
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 Codeigniter 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下 Ext.History 类(Ext4 上的 Ext.util.History)。使用它,您可以注册哈希更改的侦听器:
Ext.History 单例包括forward() 和back() 方法,用于从客户端代码内触发导航。
通过仅更改 URL 的哈希部分,浏览器将停留在同一页面上,从而无需重新加载 Ext 库。
我不能说这将如何与您的 PHP 框架集成。我不熟悉 CodeIgniter,您的示例链接会转到死页面。
另外,请注意历史记录的一个警告,因为在 Ext3 下至少它可能会给您带来新浏览器的问题。如果是这种情况,另一种方法是使用“hashchange”浏览器事件编写您自己的类似历史记录的解决方案,如 这个答案。
Have a look at the Ext.History class (Ext.util.History on Ext4). With it you can register listeners for changes to the hash:
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.