夜神月II 2019-02-15 10:38 采纳率: 0%
浏览 708

easyui 树形菜单点击事件内如何调用到Event对象

各位大佬, 请帮我看看这个问题,

在自定义js 内调用easyui 的 树形菜单, 在给定节点click事件 时,我在自定义方法内部 需要用到 event 对象, 而easyui定义的时候并没有给event对象 只给了node对象 , 我能通过重写 或者什么方法实现 调用到 event对象么?图片说明

$('#nav_left_menu').tree({
    onClick:function(node){
        e.preventDefault();
        var target_href = node.attributes.menu_url;
        if(!isEmpty(target_href)){
            clearTimeout(time);
            var time = window.setTimeout(function() {
                if (window.location.search) {
                    window.location.href = window.location.href.replace(window.location.search, '').replace(window.location.hash, '') + '#' + target_href;
                } else {
                    window.location.hash = target_href;
                }
            }, 100);
        }

        $(window).on('hashchange', function() {
            loadURL(node);
        });
    },
    onDblClick:function(node){
        $(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
        node.state = node.state === 'closed' ? 'open' : 'closed';
    }
})
  • 写回答

2条回答 默认 最新

  • 唐朝小寒 2019-02-15 15:30
    关注

    点击时获得node不就好了吗?干嘛非要事件对象

    评论

报告相同问题?

悬赏问题

  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 arduino控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题