dijit.layout.ContentPane--dojo学习

Content Pane是一个最基础的布局组件,概念上,这就象一个装内容的盒子,一个Content

Pane象一个iframe,但是它还包括额外的设计功能,自适应当前的皮肤,以及实现widgets的

属性。

 

使用方法:
你可以直接使用content pane,但通常情况下,你应该把content pane放在一个布局容器中

,例如:一个tabbed layout。

 

Href:
content panes的一个最大的用处是通过href参数来动态调入内容。但是要注意,href属性

只能访问同一个域中的数据,因为它是通过XHR来实现的。

content pane来是一些widgets的基类,如:Dialog。

 

Loading Message
当内容正在被读入的时候,显示的loading信息,可以通过改变ContentPane的

loadingMessage属性来改变。loadMessage属性的默认值是"<span

class='dijitContentPaneLoading'>${loadingState}</span>" ,所以,你可以通过应用

css到.dijitContentPaneLoading class来改变显示的信息。

 

回调Callbacks
当内容通过href读入时,一定数量的回调函数可以配置使用,在读入内容的不同阶段将会执

行:
onDownloadStart
Called before the download of the content begins.
onDownloadEnd
Called when the content has completed loading.
onDownloadError(error)
Called if there was an error with the download.

 

An example of using a callback might be as follows:

var myCp= dijit.byId("myContentPane");
myCp.attr("onDownloadEnd", function(){
  console.log("Download complete!");
});
myCp.attr("href", "myHtml.html");


 

转载于:https://www.cnblogs.com/mylem/archive/2009/12/03/1615956.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值