简体   繁体   English

Kendo UI ListView中的Kendo UI Jquery ContextMenu

[英]Kendo UI Jquery ContextMenu inside Kendo UI ListView

I am trying to use a kendo ui contextMenu on kendo ui listView items but it does work , and there is no error. 我正在尝试在kendo ui listView项目上使用kendo ui contextMenu,但它确实有效,并且没有错误。

//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) {

    }
});

Refer to the context menu demo . 请参阅上下文菜单演示 You should use the filter property of context menu. 您应该使用上下文菜单的filter属性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM