This is a migrated thread and some comments may be shown as answers.

Framework for dispatching an action for a menu item selection ?

0 Answers 51 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 02 Apr 2012, 07:42 AM
In general I guess I am asking what are people doing in the select: method.

I would like some feedback on the following

<ul id='myMenu'>
<li data-handler='miItem1;'> item 1 </li>
<li data-handler='alert("!")> item 2 </li>
</ul>

and
$('#myMenu').kendoMenu({
  select:
function (e) {
   
var handler;
   
if (handler = $(e.item).data('handler')) {
      Function (handler)();  /* construct and execute handler */
    }
  }
});

function miItem1() {
  alert('menu Item 1');
}

Thanks,

Richard

No answers yet. Maybe you can help?

Tags
Menu
Asked by
Richard
Top achievements
Rank 1
Share this question
or