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
原文链接:https://www.f2er.com/dojo/291393.html