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

Dynamic Content Loading

Partial Update Using dojox/mobile/ContentPane

In this example,there is a dojox/mobile/ContentPane widget in the transition target view. dojox/mobile/ContentPane is a very simple container widget,so it can be thought of as a <div> with the “href” attribute. This example updates the ContentPane with an external html fragment,and then performs a transition.
myAction6 = function(){
var pane1 = registry.byId("pane1");
if(!pane1.domNode.innerHTML){ // nothing has been loaded yet
connect.connect(pane1,"onLoad",this,function(){
// onLoad fires when the content is ready
this.transitionTo("view6");
});
pane1.set("href","fragment1.html");
}else{
this.transitionTo("view6");
}
}
<div id="view6" data-dojo-type="dojox/mobile/ScrollableView">
<h1 data-dojo-type="dojox/mobile/heading" data-dojo-props='back:"Home",moveto:"home",fixed:"top"'>Partial Update</h1>
<h2 data-dojo-type="dojox/mobile/RoundRectCategory">Dynamic Content</h2>
<div id="pane1" data-dojo-type="dojox/mobile/ContentPane"></div>
<ul data-dojo-type="dojox/mobile/RoundRectList">
<li data-dojo-type="dojox/mobile/ListItem" data-dojo-props='moveto:"home",transitionDir:-1'>
Home
</li>
</ul>
</div>

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

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

相关推荐