Ext javascript建立超鏈接,進(jìn)行事件處理的實(shí)現(xiàn)方法
更新時(shí)間:2009年03月22日 00:42:19 作者:
如何在javasript建立超鏈接 應(yīng)用到Ext中的樹控件事件處理
1,如何在javasript建立超鏈接
<script type="text/JavaScript">
//方法一:
location.href='網(wǎng)址';
//方法二:
document.write('<a href="網(wǎng)址">文字</a>');
</script>
2,應(yīng)用到Ext中的樹控件事件處理
tree_03.js
Ext.onReady(function(){
var root = new Ext.tree.TreeNode({ //tree,這里沒(méi)有function,使用json格式
id:1,
text:"linjq"
});
var c1 = new Ext.tree.TreeNode({
text:"child 1"
});
root.appendChild(c1);
root.appendChild(new Ext.tree.TreeNode({
text:"child 2"}));
var tree = new Ext.tree.TreePanel({
width:100,
renderTo:"content",
root:root
});
// c1.on("click",function(node,event){alert(node.text);});
// c1.on("click",function(){document.write('<a href="index.jsp">index.jsp</a>')});
c1.on("click",function(){location.href="index.jsp"});
});
<link type="text/css" rel="stylesheet" href="ext/resources/css/ext-all.css" />
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript" src="tree_03.js"></script>
</head>
<body>
<div id="content"></div>
</body>
<script type="text/JavaScript">
//方法一:
location.href='網(wǎng)址';
//方法二:
document.write('<a href="網(wǎng)址">文字</a>');
</script>
2,應(yīng)用到Ext中的樹控件事件處理
tree_03.js
復(fù)制代碼 代碼如下:
Ext.onReady(function(){
var root = new Ext.tree.TreeNode({ //tree,這里沒(méi)有function,使用json格式
id:1,
text:"linjq"
});
var c1 = new Ext.tree.TreeNode({
text:"child 1"
});
root.appendChild(c1);
root.appendChild(new Ext.tree.TreeNode({
text:"child 2"}));
var tree = new Ext.tree.TreePanel({
width:100,
renderTo:"content",
root:root
});
// c1.on("click",function(node,event){alert(node.text);});
// c1.on("click",function(){document.write('<a href="index.jsp">index.jsp</a>')});
c1.on("click",function(){location.href="index.jsp"});
});
復(fù)制代碼 代碼如下:
<link type="text/css" rel="stylesheet" href="ext/resources/css/ext-all.css" />
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript" src="tree_03.js"></script>
</head>
<body>
<div id="content"></div>
</body>
相關(guān)文章
學(xué)習(xí)YUI.Ext第七日-View&JSONView Part Two-一個(gè)畫室網(wǎng)站的案例
這篇文章主要介紹了學(xué)習(xí)YUI.Ext第七日-View&JSONView Part Two-一個(gè)畫室網(wǎng)站的案例2007-03-03
為Yahoo! UI Extensions Grid增加內(nèi)置的可編輯器
為Yahoo! UI Extensions Grid增加內(nèi)置的可編輯器...2007-03-03
ext監(jiān)聽(tīng)事件方法[初級(jí)篇]
ext監(jiān)聽(tīng)事件實(shí)例代碼2008-04-04
ext checkboxgroup 回填數(shù)據(jù)解決
解決checkboxgroup回填數(shù)據(jù)問(wèn)題的實(shí)現(xiàn)代碼2009-08-08
javascript 放大鏡 v1.0 基于Yui2 實(shí)現(xiàn)的放大鏡效果
javascript 放大鏡 v1.0 基于Yui2 實(shí)現(xiàn)的放大鏡效果代碼。2010-03-03
使用EXT實(shí)現(xiàn)無(wú)刷新動(dòng)態(tài)調(diào)用股票信息
最近開始對(duì)ExtJS感興趣了,今天正好有空,花了點(diǎn)時(shí)間,寫了個(gè)基于Ext的例子。2008-11-11
Ext面向?qū)ο箝_發(fā)實(shí)踐(續(xù))
我的上一篇文章《Ext面向?qū)ο箝_發(fā)實(shí)踐》中簡(jiǎn)述了如何編寫一個(gè)面向?qū)ο蟮臄?shù)據(jù)維護(hù)小程序,但這一些都是基于一個(gè)客戶端數(shù)據(jù),即用戶一旦刷新頁(yè)面,所有的操作都將丟失,現(xiàn)在我們就接著上一篇文章來(lái)繼續(xù)講一下如何對(duì)數(shù)據(jù)表進(jìn)行增、刪、改、查操作。2008-11-11
javascript YUI 讀碼日記之 YAHOO.util.Dom - Part.4
YAHOO.util.Dom 中的 getXY 函數(shù)讓開發(fā)者充分體驗(yàn)到不同瀏覽器的 Hack 的樂(lè)趣。IE8 即將破殼而出,但愿下面的函數(shù)不會(huì)又多個(gè) if 判斷。getXY 函數(shù)使用 匿名函數(shù)執(zhí)行返回 函數(shù)(聽(tīng)起來(lái)有點(diǎn)拗口,可以參考 圓心 Blog 上的一篇文章)。2008-03-03

