ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>国内精品伊人久久久,福利在线视频网站,色综合中文综合网http://www.aygfsteel.com/coolingverse/category/27170.html志未半斤, 才无八两. 有苦有乐, ¾pŠæ¶‚˜q‡æ´»ã€?/description>zh-cnWed, 07 Nov 2007 20:42:37 GMTWed, 07 Nov 2007 20:42:37 GMT60TreeView æ ?w¨¨i)åŞ控äšg(JS)http://www.aygfsteel.com/coolingverse/archive/2007/11/07/158891.htmlStanley SunStanley SunWed, 07 Nov 2007 09:59:00 GMThttp://www.aygfsteel.com/coolingverse/archive/2007/11/07/158891.htmlhttp://www.aygfsteel.com/coolingverse/comments/158891.htmlhttp://www.aygfsteel.com/coolingverse/archive/2007/11/07/158891.html#Feedback0http://www.aygfsteel.com/coolingverse/comments/commentRss/158891.htmlhttp://www.aygfsteel.com/coolingverse/services/trackbacks/158891.html 

treeview 

在开发B(t¨¤i)/S½E‹åºæ—Óž¼Œæˆ‘们¾lå¸¸ä¼?x¨¬)ä‹É用到一些页面çñ”的效果控件。比如:(x¨¬)æ ?w¨¨i)åŞ目录åQŒComboBox和一些其他的控äšgåQŒç”±äºŽè¿™äº›æŽ§ä»¶çš„存在使得我们的程序异常的夺目。但是在开发这些控件的时候或多或ž®‘的都会(x¨¬)比较éºÈƒ¦(ch¨³)。而大部分的程序员是ä‹É用发布的一些开源的JS控äšg来减è½Õd·¥ä½œé‡è€Œä¸”也ä‹É得自å·Þqš„½E‹åºå¥å£®ã€‚下面我介绍一个在开源社åŒÞZ¸­èµ«èµ«æœ‰åçš„æ ‘(w¨¨i)形控ä»Óž¼š(x¨¬)TreeViewã€?

首先介绍一下TreeViewåQŒTreeView原名是FolderTreeåQŒæ˜¯ä¸€‹Æ¾æ¯”较早ž®±å‡ºä¸–çš„æ ?w¨¨i)åÅžJS控äšgåQŒå½“时是ç”׃¸ªäººå¼€å‘çš„åQŒä¹‹åŽç”±å…¬å¸è´­ä¹°äº?ji¨£n)。但是现在还可以免费使用ã€?/p>

TreeView 有两个JSæ–‡äšg和一些资源文件组成。两个JSæ–‡äšg分别是:(x¨¬)主要实现功能的ftiens4.js和实现多‹¹è§ˆå™¨æ”¯æŒçš„ua.jsæ–‡äšg。只有我们在开发的™åµé¢ä¸­åŠ å…¥å¦‚ä¸Šä¸¤ä¸ªæ–‡ä»¶çš„è¯å°±å¯ä»¥å¼€å‘å¦‚ä¸Šå›¾æ‰€æ˜„¡¤ºçš„æ ‘(w¨¨i)形目录了(ji¨£n)。代码如下:(x¨¬)

<html>

<head>

<script type="text/javascript" src="../treeview/ftiens4.js" ></script>

<script type="text/javascript" src="../treeview/ua.js" ></script>

<script type="text/javascript">

//TreeView 环境变量

BUILDALL = 0 //创徏所有的节点对象 0:延时创徏 1:立即创徏
GLOBALTARGET = 'R' //节点触发时的目标 'B':打开新窗å?'R':双™¾¹çš„Frame 'S':当前Frame 'T':当前‹¹è§ˆå™¨çª—å?br>HIGHLIGHT = 0 //高ä(sh¨´)º®æ˜„¡¤ºå½“前选中的节ç‚?0:不高?sh¨´)º®æ˜¾½C?1:高ä(sh¨´)º®æ˜„¡¤º
HIGHLIGHT_BG = 'blue' //高ä(sh¨´)º®æ˜„¡¤ºçš„背景颜è‰?br>HIGHLIGHT_COLOR = 'white' //高ä(sh¨´)º®æ˜„¡¤ºçš„颜è‰?br>ICONPATH = '' //指定节点的显½Cºå›¾æ ‡ï¼Œä½¿ç”¨URL方式åQŒè€Œä¸”å¿…é¡»ç”?/"¾l“å°¾ å¦?http://www.x.com/y/
PRESERVESTATE = 0 //保存TreeView的状态到Cookie中,当再‹Æ¡æ˜¾½Cºçš„æ—¶å€™ä¼š(x¨¬)自动的回¾|®çжæ€?0:不保å­?1:保存
STARTALLOPEN = 0 //默认打开所有节ç‚?0:只打开根节ç‚?1:打开所以节ç‚?br>USEFRAMES = 1 //™åµé¢æ˜¯å¦ä½¿ç”¨äº?ji¨£n)Frame,注意åQšå¦‚果未使用Frame一定要讄¡½®æ­¤å‚æ•?0:未ä‹Éç”?1:使用äº?br>USEICONS = 1 //是否使用图标 0:不显½Cºå›¾æ ?1:昄¡¤ºå›¾æ ‡
USETEXTLINKS = 0 //节点文字是否为链æŽ?0:å?1:æ˜?br>WRAPTEXT = 0 //节点昄¡¤º­‘…出一行时是否折行 0:不折è¡?1:折行

foldersTree = gFld("test", "") //创徏一个名�test"的根节点
foldersTree.treeID = "t1" //讄¡½®test节点的唯一¾~–号ä¸?t1"


aux1 = insFld(foldersTree, gFld("Day of the week", "b.html")) //在根节点中加入一个名ä¸?Day of the week"的子节点,当点å‡Èš„时候打开b.html
aux1.addChildren([["1","1.html"],["2","2.html"],["3","3.html"],["4","4.html"],["5","5.html"]])  //在aux1节点中连¾l­åŠ å…?,2,3,4,5节点åQŒåƈ相应的打开1.html,2.html,3.html,4.html,5.html.

aux2 = insFld(foldersTree, gLnk("R","Day of the week2", "b.html")) //在根节点中加入名ä¸?Day of the week2"的节点,当点å‡Èš„时候在右侧的frame中打开b.html
aux3 = insDoc(foldersTree, gLnk("R","<input type=\"checkbox\">Day of the week3", "c.html")) //在根节点中加入名ä¸?Day of the week3"òq¶å¸¦æœ‰å¤é€‰æ¡†çš„节点,当点å‡Èš„时候在右侧的frame中打开c.html

</script>

</head>

<body>

<A style="font-size:7pt;text-decoration:none;color:silver" href=" target=_blank>Javascript Tree Menu</A>

<script type="text/javascript">

       initializeDocument();//构造TreeView

</script>

</body>

</html>

TreeView中主要的æ–ÒŽ(gu¨©)³•:

gFld(Title, Link);//创徏节点 例:(x¨¬)gFld("Test A", "javascript:parent.op()")

Argument

Title
Specifies the text that appears in the folder name. This text can include simple HTML tags, such as enclosing formatting tags (i, b, div, and so on). It can even include an img tag if you want to place a small icon in the node name, such as a "new!" icon for example.

Link
Specifies an optional URL. The URL can be a simple file name like demoFramesetRightFrame.html or a string with protocol, domain, path, and file name like
http://www.treeview.net/treemenu/demopics/beenthere_europe.gif.

 

gLnk(Target, Title, Link);//创徏一个带有链接的节点 例:(x¨¬)gLnk("B", "My File", http://www.mysite.com/MyFile.doc)

Argument

Target
Configures the target location for the link. Specify one of the following values:
"R": Open the document in the right frame (a frame named basefrm)
"B": Open the document in a new window
"T": Open the document in the current browser window, replacing the frameset if one exists
"S": Open the document in the current frame, replacing the tree
Note: This argument is case sensitive; make sure to use uppercase letters.

Title
Specifies the text that appears in the link. This text can include simple HTML tags, such as enclosing formatting tags (i, b, div, and so on). It can even include an img tag if you want to place a small icon in the node name, such as a "new!" icon for example.

Link
Specifies the URL of the document. This can be an absolute URL or a relative URL. Do not enter any other information in this string; adding a target parameter or an event handler will not work.

 

insFld(Parent Folder, Child Folder); //在父节点中插入一个子节点 例:(x¨¬)aux1 = insFld(foldersTree, gFld("Europe", "http..."))

Argument

Parent Folder
Specifies the parent folder. That is, this argument specifies the folder node in which you want to place the other folder node.

Child Folder
Specifies the child folder. That is, this argument specifies the folder node that you want to place under the parent folder node.

 

insDoc(Parent Folder, Document Node); //在节点中加入一个Dom对象 例:(x¨¬)insDoc(aux2, gLnk("S", "Boston", "..."))

Argument

Parent Folder
Specifies the parent folder. That is, this argument specifies the folder node in which you want to place the document node.

Document Node
Specifies the document node. That is, this argument specifies the document node that you want to place in the parent folder node

 

更多的参考信息到 http://www.treeview.net/tv/instructions.asp



]]>
AutoSuggest 使用手册http://www.aygfsteel.com/coolingverse/archive/2007/10/19/154307.htmlStanley SunStanley SunFri, 19 Oct 2007 10:17:00 GMThttp://www.aygfsteel.com/coolingverse/archive/2007/10/19/154307.htmlhttp://www.aygfsteel.com/coolingverse/comments/154307.htmlhttp://www.aygfsteel.com/coolingverse/archive/2007/10/19/154307.html#Feedback0http://www.aygfsteel.com/coolingverse/comments/commentRss/154307.htmlhttp://www.aygfsteel.com/coolingverse/services/trackbacks/154307.html



        AutoSuggest技术实现的一¿Uç±»ä¼égºŽComboBoxä¼?x¨¬)自动的把输入框中çš?/span>Value发送到Server自定义的解析发送的数据åQŒç„¶åŽæŠŠ˜q”回数据通过XML方式˜q”回åˆ?/span>AS再根æ?/span>Server的最新版本是autosuggest_v2.1.3AutoSuggestã€?/span>autosuggest_inquisitor.css与一ä¸?/span>test.phpâ”?nbsp;.DS_Store

â”?nbsp;._.DS_Store

â”?nbsp;._bsn.AutoSuggest_2.
1.3.html

â”?nbsp;._test.php

â”?nbsp;bsn.AutoSuggest_2.
1.3.html

â”?nbsp;test.php

â”?br />
├─css

â”?nbsp;â”?nbsp;.DS_Store

â”?nbsp;â”?nbsp;._.DS_Store

â”?nbsp;â”?nbsp;autosuggest_inquisitor.css

â”?nbsp;â”?br />
�nbsp;└─img_inquisitor

â”?nbsp;     â”?nbsp;.DS_Store

â”?nbsp;     â”?nbsp;._.DS_Store

â”?nbsp;     â”?nbsp;._as_pointer.gif

â”?nbsp;     â”?nbsp;._hl_corner_bl.gif

â”?nbsp;     â”?nbsp;._hl_corner_br.gif

â”?nbsp;     â”?nbsp;._hl_corner_tl.gif

â”?nbsp;     â”?nbsp;._hl_corner_tr.gif

â”?nbsp;     â”?nbsp;._ul_corner_bl.gif

â”?nbsp;     â”?nbsp;._ul_corner_br.gif

â”?nbsp;     â”?nbsp;._ul_corner_tl.gif

â”?nbsp;     â”?nbsp;._ul_corner_tr.gif

â”?nbsp;     â”?nbsp;as_pointer.gif

â”?nbsp;     â”?nbsp;hl_corner_bl.gif

â”?nbsp;     â”?nbsp;hl_corner_br.gif

â”?nbsp;     â”?nbsp;hl_corner_tl.gif

â”?nbsp;     â”?nbsp;hl_corner_tr.gif

â”?nbsp;     â”?nbsp;ul_corner_bl.gif

â”?nbsp;     â”?nbsp;ul_corner_br.gif

â”?nbsp;     â”?nbsp;ul_corner_tl.gif

â”?nbsp;     â”?nbsp;ul_corner_tr.gif

â”?nbsp;     â”?br />
â”?nbsp;     â””─_source

â”?nbsp;             .DS_Store

â”?nbsp;             ._.DS_Store

â”?nbsp;             ._as_pointer.png

â”?nbsp;             ._li_corner.png

â”?nbsp;             ._ul_corner.png

â”?nbsp;             as_pointer.png

â”?nbsp;             li_corner.png

â”?nbsp;             ul_corner.png

â”?br />
└─js

       .DS_Store

       ._.DS_Store

       ._bsn.AutoSuggest_2.
1.3.js

       bsn.AutoSuggest_2.
1.3.js

       bsn.AutoSuggest_2.
1.3_comp.js


AutoSuggest¾cÕdº“åQŒå…¶ä¸­ä¸»è¦çš„对象ž®±æ˜¯bsn.AutoSggestvar options_xml = {

                                script:
function(input){return"suggestAction!userName.action?signer="+input; }//(1).带有传送数据的è¯äh±‚路径åQŒå…¶ä¸­input是输入框的valueã€?/span>

                                varname:
"input"//(2).储存输入框value的变量名

                                delay:
800//(3).发送请求的延时旉™—´

                                cache:
false//(4).是否¾~“å­˜

                                noresults:
"无符合的记录åQ?/span>",//(5).当没有符合的查询¾l“果时的提示信息

                                timeout:
10000,//(6).候选框停留旉™—´

                                callback: 
function(record){ document.getElementById("temp").value = record.value; } //(7).选择候选项后的回调函数

}
;

var as_xml = new bsn.AutoSuggest('signer', options_xml); //(8).创徏autosuggest对象åQŒåƈ¾l‘定一个输入框




¾~–码äº?ji¨£n)。其中的参数表可以看下表åQ?/span>

Property

Type

Default

Description

script

String / Function

-

REQUIRED!
Either: A string containing the path to the script that returns the results in XML format. (eg, "myscript.php?")
Or: A function that accepts on attribute, the autosuggest field input as a string, and returns the path to the result script.

varname

String

"input"

Name of variable passed to script holding current input.

minchars

Integer

1

Length of input required before AutoSuggest is triggered.

className

String

"autosuggest"

Value of the class name attribute added to the generated .

delay

Integer

500

Number of milliseconds before an AutoSuggest AJAX request is fired.

timeout

Integer

2500

Number of milliseconds before an AutoSuggest list closes itself.

cache

Boolean

true

Whether or not a results list should be cached during typing.

offsety

Integer

-5

Vertical pixel offset from the text field.

shownoresults

Boolean

true

Whether to display a message when no results are returned.

noresults

String

No results!

No results message.

callback

Function

A function taking one argument: an object

json

Boolean

false

Whether or not a results are returned in JSON format. If not, script assumes results are in XML.

maxentries

Integer

25

The maximum number of entries being returned by the script. (Should correspond to the LIMIT clause in the SQL query.)

参数˜q”回åQŒå¦‚下格式的xml方式åQŒä¸˜q‡æˆ‘在这里就不在演示äº?ji¨£n)ã€?br />     

<results>

                                
<rs id="1" info="">Foobar</rs>

                                
<rs id="2" info="">Foobarfly</rs>

                                
<rs id="3" info="">Foobarnacle</rs>

</results>


AutoSuggest的解å†Ïx(ch¨®ng)–¹å¼ï¼Œæä¾›çš?/span>js脚本文äšg只有8.33 KB代码解析》ã€?br />
更多信息可查�http://www.brandspankingnew.net/archive/2007/02/ajax_auto_suggest_v2.html



]]>
Ö÷Õ¾Ö©Öë³ØÄ£°å£º ÁÙëÔÏØ| ¼ªË®ÏØ| ¾¸Î÷ÏØ| ±¦¼¦ÊÐ| °²ÄþÊÐ| ÎÚÊ²ÏØ| ÁúÑÒÊÐ| ÏʳÇ| ÔÆÑôÏØ| ÔÆÄÏÊ¡| ¸ß±®µêÊÐ| ÌÒ½­ÏØ| ÊèÀÕÏØ| Ìì¾þÏØ| ÇúÎÖÏØ| ÉÏÓÝÊÐ| ÐÂÄþÏØ| Û³ÁêÏØ| ÁéÊ¯ÏØ| ÍÁÄ¬ÌØ×óÆì| ¹ÉƱ| À´°²ÏØ| ´óÐËÇø| Î÷¼ªÏØ| ¯»ôÏØ| ÕýÀ¶Æì| ×ϽðÏØ| ĵµ¤½­ÊÐ| кÍÏØ| ËÕÖÝÊÐ| ÄϳäÊÐ| ÃñÇÚÏØ| ÀÖÁêÊÐ| Íû¶¼ÏØ| ¿µÂíÏØ| Ïã¸Û | °²ÁúÏØ| °ÔÖÝÊÐ| ½­½òÊÐ| ¸®¹ÈÏØ| аͶû»¢ÓÒÆì|