CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛
CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛
CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛

Ext javascript建立超链接,进行事件处理的实现方法

1,如何在javasript建立超链接
<script type=”text/JavaScript”>
//方法一:
location.href=’https://www.home1024.com/article/网址’;
//方法二:
document.write(‘<a href=”https://www.home1024.com/article/网址”>文字</a>’);
</script>
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(‘<a href=”https://www.home1024.com/article/index.jsp”>index.jsp</a>’)});
c1.on(“click”,function(){location.href=”https://www.home1024.com/article/index.jsp”});
});

实现代码如下:

<link type=”text/css” rel=”stylesheet” href=”https://www.home1024.com/article/ext/resources/css/ext-all.css” />
<script type=”text/javascript” src=”https://www.home1024.com/article/ext/adapter/ext/ext-base.js”></script>
<script type=”text/javascript” src=”https://www.home1024.com/article/ext/ext-all.js”></script>
<script type=”text/javascript” src=”https://www.home1024.com/article/tree_03.js”></script>
</head>
<body>
<div id=”content”></div>
</body>

以上就是【Ext javascript建立超链接,进行事件处理的实现方法】的全部内容了,欢迎留言评论进行交流!

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏 分享
相关推荐
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容