smartclient框架组件介绍4(ResourceTreeGrid,HTMLPane)
来源:互联网 发布:中国人有钱知乎 编辑:程序博客网 时间:2024/06/06 02:46
资源树组件封装了获取资源树相关信息的功能。
效果图
组件属性、方法清单
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内容很多,组件将会提供滚动条
效果图
组件属性、方法清单
属性
名称/描述
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框架组件介绍4(ResourceTreeGrid,HTMLPane)
- smartclient框架组件介绍2(UploadForm,PageListGrid)
- smartclient框架组件介绍1(Timer,json处理工具,XMLTools)
- smartclient框架组件介绍3(Menu,MenuItem,MenuButton)
- smartclient框架组件介绍5(Img,Label,IButton,ToolStrip)
- smartclient框架组件介绍6(DynamicForm,FormItem,FormItemType)
- smartclient框架组件介绍7(Canvas,TabSet,Window)
- smartclient框架组件介绍8(ListGrid,TreeGrid,Tree)
- smartclient框架组件介绍9(GraphPie,GraphBar,GraphLine)
- smartclient框架组件介绍10(GraphMeter,GraphMeter2,GraphBarVsLine)
- SmartClient 介绍
- SmartClient组件使用
- SmartClient组件简介
- SmartClient新建组件实例
- SmartClient Ajax平台介绍
- SmartClient常用组件接口说明
- 使用SmartClient框架画 界面
- SmartClient
- Java 编程思想(第四版)学习笔记(2)一切都是对象
- c++11的std::memory_order
- 关于MAVEN的初学
- 变量与常量
- chkconfig: command not found
- smartclient框架组件介绍4(ResourceTreeGrid,HTMLPane)
- open jdk javap对于class文件的解析分析
- Android 布局笔记
- Scaleform Gfx的Demo
- 敏捷开发“松结对编程”系列之十:L型代码结构(技术篇之一)
- autobench快速入门
- WPF 密码框输入密码时强制使用英文输入法
- 八款开源 Android 游戏引擎 (巨好的资源)
- Linux在线文档man、info的使用