smartclient框架组件介绍4(ResourceTreeGrid,HTMLPane)
2012-08-21 11:11
375 查看
ResourceTreeGrid:资源树组件
资源树组件封装了获取资源树相关信息的功能。
![](http://my.csdn.net/uploads/201208/21/1345519424_6986.png)
资源树节点的属性:
ResourceTreeGrid.create({
ID:"resourceTree",
left:50, top:50, width:300, height:500,
rowContextClick : function( record ) //设置右键事件
{
this.contextMenu = Menu.create({
width : 100,
data:[{
title : "刷新",
resourceTreeGrid : this,
icon : "uep-2/unacknownledge.gif",
click : function()
{
this.resourceTreeGrid.data.reloadChildren(record);
}
}]});
this.showContextMenu();
},
recordClick: "isc.say('clicked country: <b>'+record. name
+'</b>')", //设置单击事件
recordDoubleClick: "isc.say('Double-clicked country: <b>'+record.
name +'</b>')" //设置双击事件
});
resourceTree.fetchData({moc:["Virtual Ne", "Common Group"], userName:"admin"});
HTMLPane:
HTMLPane组件可以用来显示html内容,如果html内容很多,组件将会提供滚动条
![](http://my.csdn.net/uploads/201208/21/1345519493_8153.png)
资源树组件封装了获取资源树相关信息的功能。
效果图
![](http://my.csdn.net/uploads/201208/21/1345519424_6986.png)
组件属性、方法清单
ResourceTreeGrid提供资源相关的数据,现在支持按资源类型过滤,该组件继承自TreeGrid,具有TreeGrid的所有方法。资源树组件的方法:方法 | 名称/描述 |
Create | 创建资源树组件,一般组件都是通过这个方法创建实体对象 |
fetchData | 查询资源数据,条件参数为JSON对象,比如根据资源类型和用户名查询:fetchData({moc:["Virtual Ne", "Common Group"], userName:"admin"}); |
方法 | 名称/描述 |
locateId | 资源树在树上的位置ID,为主键 |
parentLocateId | 资源树在树上父节点ID,指明外键 |
oid | 资源编号 |
name | 资源名字 |
ipAddress | 网元ip地址,该属性可能为空,只有网元才有此属性 |
location | 资源所在位置,该属性可能为空 |
connectionState | 资源连接状态,该属性后续在界面是以状态小图标的方式呈现 |
managementState | 资源管理状态,该属性后续在界面是以状态小图标的方式呈现 |
workState | 资源工作状态,该属性是一个数组 |
visible | 资源可见状态,如果为false,资源不能在界面显示 |
movable | 资源可移动状态,如果为false资源不能在树上移动位置 |
timeZone | 资源时区 |
description | 资源描述,该属性可能为空 |
create方法
详述
方法名 | Create | |
概述 | 通过输入设置的各个属性创建对应的资源树 | |
返回 | 资源树的实体对象 | |
参数(可以是树组件的任意一个属性) | 参数 | 说明 |
ID | 树组件的ID | |
rowContextClick | 设置节点右键响应事件 | |
recordClick | 设置节点单击事件 | |
recordDoubleClick | 设置节点双击事件 |
使用示例
示例一:ResourceTreeGrid.create({
ID:"resourceTree",
left:50, top:50, width:300, height:500,
rowContextClick : function( record ) //设置右键事件
{
this.contextMenu = Menu.create({
width : 100,
data:[{
title : "刷新",
resourceTreeGrid : this,
icon : "uep-2/unacknownledge.gif",
click : function()
{
this.resourceTreeGrid.data.reloadChildren(record);
}
}]});
this.showContextMenu();
},
recordClick: "isc.say('clicked country: <b>'+record. name
+'</b>')", //设置单击事件
recordDoubleClick: "isc.say('Double-clicked country: <b>'+record.
name +'</b>')" //设置双击事件
});
fetchData方法
详述
方法名 | fetchData |
概述 | 根据条件对资源树进行查询 |
返回 | 根据条件对资源树进行查询的结果 |
使用示例
根据资源类型即moc的值和当前登录的用户名进行资源查询:resourceTree.fetchData({moc:["Virtual Ne", "Common Group"], userName:"admin"});
HTMLPane:
HTMLPane组件可以用来显示html内容,如果html内容很多,组件将会提供滚动条
效果图
![](http://my.csdn.net/uploads/201208/21/1345519493_8153.png)
组件属性、方法清单
属性 | 名称/描述 |
contentsURL : URL | 组件需要显示的html的URL |
contentsType : String | 显示html的方式 |
contentsURLParams : Object | 组件需要显示的html的URL的参数 |
dynamicContents : Boolean | Dynamic contents allows the contents string to be treated as a simple, but powerful template. When this attribute is set to true, expressions of the form ${arbitrary JS here} are replaced by the result of the evaluation of the JS code inside the curly brackets. This evaluation happens at draw time. If you want to trigger a re-evaluation of the expressions in the contents string you can call markForRedraw() on the canvas. |
evalScriptBlocks | If evalScriptBlocks is true, HTMLFlow will pre-process the loaded HTML in order to mimic how the HTML would execute if it were loaded as an independent page or loaded via an IFRAME. |
httpMethod : SendMethod | Selects the HTTP method that will be used when fetching content. Valid values are "POST" and "GET". |
loadingMessage : HTML | HTML to show while content is being fetched, |
方法 | 名称/描述 |
contentLoaded | 当组件的内容加载完成后该方法会被触发 void contentLoaded () |
handleError | 当组件加载的内容加载错误的时候该方法会被调用 Boolean handleError (rpcRequest:RPCRequest,rpcResponse:RPCResponse ) |
loadingContent | 当组件正在从服务端加载内容的时候该方法返回true void loadingContent () |
setContentsURL | 设置组件内容的url void setContentsURL ([url, params]) |
transformHTML | 覆盖该方法可以对加载的html内容进行修改后再显示 void transformHTML (html) |
相关文章推荐
- smartclient框架组件介绍8(ListGrid,TreeGrid,Tree)
- smartclient框架组件介绍2(UploadForm,PageListGrid)
- smartclient框架组件介绍3(Menu,MenuItem,MenuButton)
- smartclient框架组件介绍5(Img,Label,IButton,ToolStrip)
- smartclient框架组件介绍6(DynamicForm,FormItem,FormItemType)
- smartclient框架组件介绍9(GraphPie,GraphBar,GraphLine)
- smartclient框架组件介绍10(GraphMeter,GraphMeter2,GraphBarVsLine)
- smartclient框架组件介绍7(Canvas,TabSet,Window)
- 介绍一款jquery ui组件gijgo(含tree树状结构、grid表格),特点:简易、文档全清晰易懂、示例代码
- smartclient框架组件介绍1(Timer,json处理工具,XMLTools)
- Ext2.0框架的Grid使用介绍
- python pytest测试框架介绍四----pytest-html插件html带错误截图及失败重测机制
- Extjs4中的常用组件:Grid、Tree和Form
- SSM框架系列学习总结8之SpringMVC核心组件介绍
- Ext2.0框架的Grid使用介绍--转载http://blog.csdn.net/chiangbt/archive/2008/01/24/2064117.aspx
- Ext 介绍入门之 Tutorial: Grid组件的简易分页
- 基于Tiles框架Struts框架的UI 设计—几种组织HTML和JSP视图组件
- EX_NET团队产品介绍-----HTML报表打印组件(ajax)
- Lind.DDD.Messaging框架通讯组件介绍
- ssm框架组件及介绍