易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript树

 
/** 配置参数 */
function TreeConfig() {
    this.showIco = true;
    this.showCheckBox = false;
    this.checkBoxName = "_TREE_CHECKBOX_";
    this.checkBoxRelated = false;
}
/**
* 节点类
* 节点目前默认支持的属性有:
* text, url, target, cb, cbname, cbchecked, cbval, ico, icoFile, icoOpen
*/
function Node(id, parentId, attributes) {
    this.id         = id;  // 节点自身id
    this.parent     = parentId   || ""; // 父id
    this.attributes = attributes || {}; // 节点属性
    this._created  = false;
    this._expanded = false;
    this._checked  = false;
}
// 得到节点属性
Node.prototype.getAttribute = function(key) {
    var attr = this.attributes[key];
    return (attr==undefined || attr=="")? null : attr;
}
// 得到节点属性
Node.prototype.setAttribute = function(key, value) {
    this.attributes[key] = value;
}
/** 树类 */
function TissonTree(instanceName, config) {
    this.instanceName = instanceName || "tree";  // 实例名
    this.nodes = {};     // 所有节点集
    this.nodeArray = null; // 包含所有节点的数组
    this.nodeLink = {};  // 父-子节点对应关系集
    this.rootId = "-1";  // 默认根节点id
    this._baseImagesPath = "/SmtCCS_tkms/images/tree/"; // 图片的基本路径
    this._checkedNodes = {};
    this.selectedNode = null;
    this.selectedNodeId = "";
    this.nextSearchIndex = 0;
    this.searchText = "";
    this.treeStage = null;
   &


相关文档:

12款Javascript 表格控件(javaeye)

    12款JavaScript表格控件。表格控件(DataGrid )允许最终用户阅读和写入到绝大多数数据库的应用程序。DataGrid 控件可以在设计时快速进行配置,只需少量代码或无需代码。当在设计时设置了DataGrid 控件的 DataSource 属性后,就会用数据源的记录集来自动填充该控件,以及自动设置该控件的列标头。然后您就 ......

javascript学习小结

 0.链接css文件和js文件
<link rel="stylesheet" href="../css/style.css" mce_href="css/style.css" type="text/css">
<mce:script language="javascript" src="../includes/jslib.js" mce_src="includes/jslib.js" ></mce:script>
1.关闭输入法

<input style="ime-mode ......

Javascript中最常用的55个经典技巧

 1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......

JavaScript 三种构造对象的方法

//第一种构造方法:   new Object()
var  a  = new Object();
a.x = 1, a.y = 2;
//第二种构造方法:    对象直接量
var  b = {x:1,y:b};
//第三种构造方法:    定义类型
function   Point(x,y)
{
       ......

10种AJAX/JavaScript特效实例让你的网站更吸引人

 今天的话题是如何改进自己网站的界面或提高网站的视觉体验,从而让用户记忆犹新。
  我们有三种主要的方法(从难到易):自己动手写脚本;使用类似于jQuery和mooTools的JavaScript框架(可以让编写代码变得更容易些);使用能工作于现有的JavaScript框架下的提前预置好的脚本或那种从头开始开发的创建者。这篇文章适合那 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号