Kendo UI Jquery ContextMenu inside Kendo UI ListView

Kendo UI Jquery ContextMenu inside Kendo UI ListView

我正在尝试在 kendo ui listView 项目上使用 kendo ui 上下文菜单,但它确实有效,而且没有错误。

//The ListView HTML
<div id="listView"></div>
<div id="pager" class="k-pager-wrap"></div>

 <script type="text/x-kendo-template" id="template">
        <div class="document">
            <img width="65px" height="65px" src="../Content/extensionsIcon/#=FileExtension#.png" alt="#: DocTitle #" />
            <h5>#:DocTitle#</h5>
        </div>
    </script>

 //The ContextMenu HTML 
 <ul id="context-menu">
<li id="download">Download</li>
<li id="remove">Remove</li>
</ul>


 $("#context-menu").kendoContextMenu({
    target: "#listView .document",
    select: function (e) {

    }
});

参考上下文菜单的上下文菜单demo. You should use the filter 属性。

      $("#context-menu").kendoContextMenu({
                    target: "#listView",
                    filter: ".document",                    
                    select: function(e) {
                        // Do something on select
                    }
       });