0

I would like to open specific menu item and set focus on keydown event.

I can open kendo menu by following code but can't set focus over there.

Thanks is Advance !

              <ul id="menu">
                  
                    <li>
                        Test
                    </li>
                    <li>
                        Master
                        <ul id="ulMaster">
                            <li>County</li>
                            <li>State</li>
                            <li>City</li>
                            
                        </ul>
                    </li>
                    <li>
                        Transaction
                        <ul>
                            <li> Service Order </li>
                            <li> Technician Payment </li>
                        </ul>
                    </li>
              </ul>
 document.body.onkeydown = function (e) {
                var event = e || window.event
                var key = e.charCode || e.keyCode;
                if (event.altKey) {
                switch (key) {
                        case 68: // D
                            $("#ulMaster").trigger("mouseover");
                            break;
                    }
                }

$("#menu").kendoMenu({});
AGH
  • 353
  • 1
  • 14

1 Answers1

1

You can attach an event handler to Menu select event like this:

$("#menu").onkeydown({ select: function (e) {
    console.log(e.item);
} });

You also get the menu item in the event argument. All The Best . Vote if your Code Working

Guru
  • 81
  • 1
  • 2