(以后有分享的东西,一定尽早写出来。这一拖不知不觉就两三个月了)
因为项目需要,当界面返回时需要刷新之前的界面,网上也没找到这方面的资料,最终选择从源码着手,找到了解决问题的方案。
通过查看AppFramework的源码发现,点击界面上的返回按钮时js方法调用顺序如下:
goBack->loadContent->loadDiv->parsePanelFunctions。
我们看一下parsePanelFunctions方法的注释信息:
/**
* This is used when a transition fires to do helper events. We check to see if we need to change the nav menus, footer, and fire
* the load/onload functions for panels
```
$.ui.parsePanelFunctions(currentDiv, oldDiv);
```
* @param {object} what current div
* @param {object=} oldDiv old div
* @param {boolean=} goBack
* @title $.ui.parsePanelFunctions(currentDiv, oldDiv);
* @api private
*/
简单的意思就是,这个方法是界面切换时候调用的方法ÿ