【问题标题】:Links inside JsTree treeview not workingJsTree 树视图中的链接不起作用
【发布时间】:2015-08-10 20:24:33
【问题描述】:

我有一个树视图,其中包含最低节点中的表。表格中有某些链接,但链接不会重定向到它们应该重定向的页面。链接地址在浏览器底部可见,但链接不调用它们应该调用的 ActionMethod(它们根本不调用它们)。 谁树有很多数据,所以我发布了一个简短的例子来说明大树的外观。

<div id="tree">
<ul>
    <li>item1</li>
    <li>item2
        <ul>
            <li>inner item1 
                <table>
                    <tr>
                        <th>Hello</th>
                        <th><a href="~/Views/home/ActivatePage">link</a></th>
                    </tr>
                    <tr>
                        <th>Hello</th>
                        <th><a href="~/Views/home/ActivatePage">link</a></th>
                    </tr>
                </table>
            </li>
            <li>aa</li>
        </ul>
    </li>
    <li>item3</li>
</ul>

任何可能发生这种情况的线索,因为当我将链接粘贴到浏览器字段时,链接会起作用。

【问题讨论】:

    标签: asp.net asp.net-mvc-4 treeview jstree


    【解决方案1】:

    jstree select_node 阻止导航。试试这个

        $('body').on('click','a',function(){
    window.location=$(this).attr('href');
    });
    

        $('#tree').on('click','a',function(){
    window.location=$(this).attr('href');
    });
    

    check at

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多