positioning kendo right click menu

I have right click menu (contentmenu) but it show only in one static position (int he bottom). Can you help me? I use this code:

<ul class ="k-column-menu" id="contextmenu" style=" display:none; position: absolute; background-color:white; border-style:solid; border-width:1px;" >
<li>Genres</li>
<li>About</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>

and this

$(document).ready(function () {
        $(document).bind('contextmenu', function (event){
            $("#contextmenu").kendoMenu({ position: "relative", orientation: "vertical" }).show();
         event.preventDefault();
        });

        $(document).bind('click', function () {
                $("#contextmenu").hide();
        });

    });

I solved this issue like this:

$(document).ready(function () {
        $(document).bind('contextmenu', function (event){
            $("#contextmenu").css({ "top": event.pageY + "px", "left": event.pageX + "px" }).kendoMenu({orientation: "vertical"}).show();
            event.preventDefault();
        });

        $(document).bind('click', function () {
                $("#contextmenu").hide();
        });

    });

Iwant to ask another question. How can i make this menu to show only when right clicking on the columns header and nowhere else on the page or table

Answers


You just need to specify the <th> tag when you bind the click event.

Updated link:

Here is a simple example.!

Another Update

and here is another example according your requirement you only need to change

this:

$(document).bind('contextmenu', function (event){
     $("#contextmenu").kendoMenu({ position: "relative", orientation: "vertical"}).show();
     event.preventDefault();
});

to this:

$(".k-header").bind('contextmenu', function (event){
     $("#contextmenu").kendoMenu({ position: "relative", orientation: "vertical"}).show();
     event.preventDefault();
});

Need Your Help

upload a update built with xamarin (mono touch ) to an existing application built with xcode

ios xcode xamarin.ios app-store

I have a application on app store which was earlier built with xcode.But now we are developing apps using xamarin .

How to add one folder on different branch

git github version-control gitlab

I am trying to add one folder in different branch. In my master branch I have all the folders. I created new branch using: