微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

DOJO――View navigation history management

View navigation history management Authors: Yoshiroh Kamiyama

The bookmarkable feature

In Dojo Mobile 1.8,the bookmarkable function has been enhanced to be able to manage the state of multiple views. The bookmarkable feature is enabled if you require the module dojox/mobile/bookmarkable. When you make a view transition,dojox/mobile/bookmarkable searches for all the selected views in the page,and sets a new fragment id that consists of a comma-separated list of the found views (ex. #page2,bar3,view0) to the browser’s current URL. When you move back to this page,dojox/mobile/bookmarkable sees the list of selected views and restores the selected state. Note that ‘selected’ does not necessarily mean the view is ‘visible’. For example,there may be a currently hidden view that has child views. One of the child views is ‘selected’,but it is not ‘visible’ since its parent is currently hidden. Sibling views always have one and only one selected view.

Example:
<script>
require([
"dojox/mobile",
"dojox/mobile/bookmarkable",
....
]);
</script>
<div id="home" data-dojo-type="dojox/mobile/View">
<ul data-dojo-type="dojox/mobile/RoundRectList">
<li data-dojo-type="dojox/mobile/ListItem" data-dojo-props='moveto:"#page1"'>
Go to page 1
</li>
<li data-dojo-type="dojox/mobile/ListItem" data-dojo-props='moveto:"#page2"'>
Go to page 2
</li>
</ul>
</div>

The bookmarkable feature should be able to handle cases where views are nested or split. However,it cannot support dynamic views created by ListItem and other _ItemBase-based item’s ‘url’ property. Even if the created view’s IDs are pushed to the browser URL’s fragment id,dojox/mobile/bookmarkable can never kNow the URL of the external content from its view id.

If you set mblForceBookmarkable:true to dojoConfig or data-dojo-config,and require dojox/mobile/bookmarkable,all the view transitions are stored in the browser history regardless of whether the value of ‘moveto’ has the ‘#’ prefix or not. In this case,you can omit the ‘#’ prefix as shown in the example below.
<script src=\'#\'" /dojo.js" data-dojo-config="...,mblForceBookmarkable: true"></script>
<script>
require([
"dojox/mobile",
....
]);
</script>
<div id="home" data-dojo-type="dojox/mobile/View">
<ul data-dojo-type="dojox/mobile/RoundRectList">
<li data-dojo-type="dojox/mobile/ListItem" data-dojo-props='moveto:"page1"'>
Go to page 1
</li>
<li data-dojo-type="dojox/mobile/ListItem" data-dojo-props='moveto:"page2"'>
Go to page 2
</li>
</ul>
</div>

转自:http://dojotoolkit.org/reference-guide/1.9/dojox/mobile/bookmarkable.html#dojox-mobile-bookmarkable

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


我有一个网格,可以根据更大的树结构编辑小块数据.为了更容易知道用户保存了什么,我希望当用户第一次看到网格时,网格处于不可编辑状态.当用户准备好后,他们可以单击编辑按钮,这将使网格的某些部分可编辑.然后,有一个保存或取消按钮可以保存更改或还原.在大多数情况下它是有效的.但
我即将开始开发一款教育性的视频游戏.我已经决定以一种我可以轻松打包为Web,Mobiles和可能的Standalone版本的方式来实现这一目标.我不想使用Flash.因此,我确信(无论如何我会听取建议)使用JavaScript和SVG.我正在对这个问题进行大量研究,但我很难把各个部分放在一起.我知道Raphae
我正在使用带有Grails2.3.9的Dojo1.9.DojoNumberTextBox小部件–我在表单中使用–将固定格式(JavaScript基本格式)的实数值(例如:12.56)设置为HTML表单输入字段(但根据浏览器区域设置显示/编辑它们,所以用户总是看到格式正确的数字).另一方面,Grails期望输入字段根据浏览器
1.引言鉴于个人需求的转变,本系列将记录自学arcgisapiforjavaScript的学习历程,本篇将从最开始的arcgisapiforjavaScript部署开始,个人声明:博文不在传道受业解惑,旨在方便日后复习查阅。由于是自学,文章中可能会出现一些纰漏,请留言指出,不必留有情面哦!2.下载ArcGISforDe
我正在阅读使用dojo’sdeclare进行类创建的语法.描述令人困惑:Thedeclarefunctionisdefinedinthedojo/_base/declaremodule.declareacceptsthreearguments:className,superClass,andproperties.ClassNameTheclassNameargumentrepresentsthenameofthec
我的团队由更多的java人员和JavaScript经验丰富组成.我知道这个问题曾多次被问到,但为了弄清楚我的事实,我需要澄清一些事情,因为我在客户端技术方面的经验非常有限.我们决定使用GWT而不是纯JavaScript框架构建我们的解决方案(假设有更多的Java经验).这些是支持我的决定的事实.>
路由dojo/framework/srcouting/README.mdcommitb682b06ace25eea86d190e56dd81042565b35ed1Dojo应用程序的路由路由FeaturesRoute配置路径参数RouterHistoryManagersHashHistoryStateHistoryMemoryHistoryOutletEventRouterContextInjectionOutl
请原谅我的无知,因为我对jquery并不熟悉.是否有dojo.connect()的等价物?我找到了这个解决方案:http:/hink-robot.com/2009/06/hitch-object-oriented-event-handlers-with-jquery/但是没有断开功能!你知道jquery的其他解决方案吗?有jquery.connect但这个插件在我的测试中不起作用.
与java类一样,在dojo里也可以定义constructor 构造函数,在创建一个实例时可以对需要的属性进行初始化。//定义一个类mqsy_yjvar mqsy_yj=declare(null,{     //thedefaultusername    username: "yanjun",          //theconstructor   
我一直在寻找一些最佳实践,并想知道Dojo是否具有框架特定的最佳实践,还是最好只使用通用的Javascript标准?特别是我主要是寻找一些功能和类评论的指导方针?解决方法:对于初学者来说,这是项目的风格指南:DojoStyleGuide