Ext javascript建立超链接,进行事件处理的实现方法_YUI.Ext相关
程序员文章站
2022-03-20 09:40:57
...
1,如何在javasript建立超链接
2,应用到Ext中的树控件事件处理
tree_03.js
Ext.onReady(function(){
var root = new Ext.tree.TreeNode({ //tree,这里没有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('index.jsp')});
c1.on("click",function(){location.href="index.jsp"});
});
2,应用到Ext中的树控件事件处理
tree_03.js
复制代码 代码如下:
Ext.onReady(function(){
var root = new Ext.tree.TreeNode({ //tree,这里没有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('index.jsp')});
c1.on("click",function(){location.href="index.jsp"});
});
复制代码 代码如下: