I'm working with the Kendo UI menu widget, and would like to only trigger the onSelect event when the last child menu item has been selected:
For example, let's say I select "Business Group" menu item below. I then want to trigger additional functions. However, if I click on "Report" I don't want to do anything.
It's probably something easy like checking for last child, but I'm still trying to figure that out.
Here's the HTML code with "kendo-menu" widget:
<div class="widget-content text-left text-info" style="float:left; border:none;">
<div class="widget-content" text-left text-info style="float:left; border:none; width:100px;">
<span>
<ul kendo-menu style="display: inline-block" k-orientation="vm.menuOrientation"
k-rebind="vm.menuOrientation" k-on-select="vm.onSelect(kendoEvent)" k-closeOnClick="false">
<li>
Reports
<ul>
<li>VaR
<ul>
<li>Business Group</li>
<li>Stress Scenarios</li>
<li>IR Risk - PV10</li>
</ul>
</li>
<li>Ctrpty
<ul>
<li>
<a href="../index.html#/dashboard">Industry</a>
</li>
<li>
<a href="index.html#/dashboard?repttype='MTM'">MTM</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</span>
</div>
In my javascript controller code, I wire up the event:
vm.onSelect = function (ev) {
changeReportType(ev);
};
However it fires every time I click any of the menu items. I'd like to react on the bottom most item only.