论坛首页 AJAX版 YUI

使用layout点击west的tree的链接在center中显示并不弹出新的页面(已解决)

浏览 3572 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
时间:2007-09-25
下面的代码可以解决叶节点有链接时在iframe中显示链接网页
没有链接时不做反应,ie firefox下通过
tree.on('click', function (node){
if(node.isLeaf()){
if(node.attributes.hrefTarget===undefined){
node.attributes.hrefTarget='#';
//如果为undefined就赋值为'#',返回
return;
}
// alert(node.attributes.hrefTarget);
try {Ext.get('iframe').dom.src = node.attributes.hrefTarget ; } catch(e){}
//没有try catch firefox会报错
}

} ,
this,
{stopEvent:true}
);
   
0 请登录后投票
时间:2007-09-25
tree.on('click', function (node){
if(node.isLeaf()){
if( node.attributes.hrefTarget===undefined){
node.attributes.hrefTarget='#';
return;
}
// alert(node.attributes.hrefTarget);
try {Ext.get('iframe').dom.src = node.attributes.hrefTarget ; } catch(e){}
//不可以使用href代替hrefTarget,否则打开新窗口显示新url内容
}

} ,
this,
{stopEvent:true}
);
   
0 请登录后投票
论坛首页 AJAX版 YUI

跳转论坛:
JavaEye推荐
    快速回复 引用上一条消息 (Alt+S)