Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open kendo menu by clicking hyperlink instead of mouse Hover on kendo menu....

[Add New Condition]


JavaScript:
JavaScript
function check() {
        //alert('check')
        var myContextMenu = $("#Menu").kendoContextMenu({
            //target: "#target",
        }).data("kendoContextMenu");
        //$("#idItem").click(function (e) {
        //    myContextMenu.open();
        //});
    }



@(Html.Kendo().Menu()
.Name("Menu")
.Items(items =>
{
items.Add()
.Text("Customer")
.Items(children =>
{
children.Add().Text("Company Name")
.Items(innerChildren =>
{
//innerChildren.Add().Text("Tables & Chairs").Text(Html.CheckBox("test").ToHtmlString()).Encoded(false);;
innerChildren.Add().Text("Company Id");
//innerChildren.Add().Text("Occasional Furniture");

});

children.Add().Text("Employee Name")
.Items(innerChildren =>
{
innerChildren.Add().Text("Employee Id");
//innerChildren.Add().Text("Throws");

});

children.Add().Text("Job")
.Items(innerChildren =>
{
innerChildren.Add().Text("Job Desc");
//innerChildren.Add().Text("Kids Storage");

});

children.Add().Text("Currency")
.Items(innerChildren =>
{
innerChildren.Add().Text("Description");
//innerChildren.Add().Text("Table");

});
});
})
.Events(e => e.Open("open").Close("close").Select("select").Activate("activate").Deactivate("deactivate"))

)
Posted
Comments
Raje_ 28-Dec-15 7:25am    
Repeating your question will not help. You should have improved your last question.
http://www.codeproject.com/Questions/1067444/How-to-open-kendo-menu-from-hyperlink-clickevent-n
Any ways check this thread :
http://www.telerik.com/forums/menu-onclick-open-close

You can try this code :

Menu onClick Open & Close - Menu - Kendo UI Forum[^]

It say's :

For those wanting click-only open/close functionality, I achieved it by commenting out this code from kendo.all.min.js:
(!c.options.openOnClick||c.clicked)&&!N(b.currentTarget,b.relatedTarget)&&e&&c.open(d),c.options.openOnClick&&c.clicked&&d.siblings().each(g(function(a,b){c.close(b)},c))

And by setting openOnClick to true.

[Edit]
I think above feature has already been added in new kendo. Could you please try below code and see if it works :

@(Html.Kendo().Menu()
      .Name("menu")
      .OpenOnClick(true) //add this method to enable click feature
)


Good luck.
 
Share this answer
 
v2
Comments
Sathish km 28-Dec-15 7:52am    
didn't found in this script..
Sathish km 28-Dec-15 7:52am    
Please tell any changes in my code.
Raje_ 28-Dec-15 8:05am    
try my edited answer and see if it works or not.
Sathish km 28-Dec-15 9:02am    
thkx. yes it works through click function but i want to open it by hyperlink action.
Found your answer from this link buddy

Kendo UI Context Menu example[^]


And also this link can be very useful for you at the end of the day dude.

MVVM support in Kendo UI Menu[^]

And you can also follow this one

Basic usage of Kendo UI Menu Navigation widget | Kendo UI Web demo[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900