<script type="text/javascript">
Ext.onReady(function()
{
var hello = function()
{
Ext.Msg.alert("ok","how are you?");
}
var leaf1 = new Ext.tree.AsyncTreeNode({
text: "用户列表",
id:'user_list',
editable: true,
listeners : {click : hello},
leaf: true
});
var leaf2 = new Ext.tree.AsyncTreeNode({
text: "用户添加",
id:'add_input',
leaf: true
});
root = new Ext.tree.AsyncTreeNode({
text: "用户",
draggable:false,
allowChildren: true,
listeners : {click : hello},
children:[leaf11,leaf12]
});
treePanel = new Ext.tree.TreePanel({
animate:true,
autoScroll:true,
enableDD:true,
containerScroll: true,
border: false,
dropConfig: {appendOnly:true}
});
treePanel1.setRootNode(root1);
});
问题:这棵树产生的效果是这样的 +用户
-----用户列表
-----用户添加
当单击用户根节点时,能执行hello方法,其属性href 也能成功导向url
但是当单击其子节点 用户列表或用户添加时,不能执行hello()方法,其属性href也失效。
EXT新手疑惑中,恳请高手帮助! 谢谢。
Ext.onReady(function()
{
var hello = function()
{
Ext.Msg.alert("ok","how are you?");
}
var leaf1 = new Ext.tree.AsyncTreeNode({
text: "用户列表",
id:'user_list',
editable: true,
listeners : {click : hello},
leaf: true
});
var leaf2 = new Ext.tree.AsyncTreeNode({
text: "用户添加",
id:'add_input',
leaf: true
});
root = new Ext.tree.AsyncTreeNode({
text: "用户",
draggable:false,
allowChildren: true,
listeners : {click : hello},
children:[leaf11,leaf12]
});
treePanel = new Ext.tree.TreePanel({
animate:true,
autoScroll:true,
enableDD:true,
containerScroll: true,
border: false,
dropConfig: {appendOnly:true}
});
treePanel1.setRootNode(root1);
});
问题:这棵树产生的效果是这样的 +用户
-----用户列表
-----用户添加
当单击用户根节点时,能执行hello方法,其属性href 也能成功导向url
但是当单击其子节点 用户列表或用户添加时,不能执行hello()方法,其属性href也失效。
EXT新手疑惑中,恳请高手帮助! 谢谢。
解决方案 »
- AnimatedGifEncoder 生成的图片背景颜色与图标背景颜色如何设置透明
- struts2.1.8 redirectAction 跳转问题
- 请问下 struts2.1 和struts2.0 有什么区别吗
- 关于hql的 的一个问题。
- Struts上传文件问题!!!!!
- hibernate 视图 复合主键的问题
- 求概率分布抽奖函数的方法
- 菜鸟问题:什么是架构,框架??
- 怎么提高自己的编程能力,不想再copy别人的代码,有什么好的项目拿来学习
- Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (build-image)
- strust2 action跳转问题
- xFire结合spring2.x问题
alert("hello");
})