Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 18:55:13
Original
1691 people have browsed it

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:









Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template