Home >Web Front-end >JS Tutorial >Ext javascript establishes hyperlinks and implements event processing methods_YUI.Ext related

Ext javascript establishes hyperlinks and implements event processing methods_YUI.Ext related

WBOY
WBOYOriginal
2016-05-16 18:55:131738browse

1. How to create a hyperlink in javasript

2, applied to tree control event processing in Ext
tree_03.js

Copy code The code is as follows:

Ext.onReady(function() {
var root = new Ext.tree.TreeNode({ //tree, there is no function here, use json format
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"});
});

Copy code The code is as follows:









Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn