Hiya,
I have a WebDataMenu (EnableAppStyling=true) for which I trigger various actions via OnItemClick. When an item is clicked, it is selected (becomes active) and is highlighted as such; a feature I do not want.
I've looked around for a Javascript function i could use to unselect, or a property that lets me stop selection but have had no luck so far. Obviously I could change the css on highlighting to hide the aesthetics, but is there a better way to do this rather than overriding the app styling?
Cheers,Stafford.
Hello Stafford,
You could achieve your target by handling a couple of client-side events:
<
First you have to cancel the selection from ItemSelecting event:
function
iSelecting(menu, args) { var item = args.getItem(); args.set_cancel(true);}
Then, remove the "active" state of an item, which just closed:
iCollapsed(menu, args) { var item = args.getItem(); item.set_active(false);}
And finnaly a little hack for non-parent items:
function iClick(menu, args) { var item = args.getItem(); var f = function() { item.set_active(false); window.setTimeout(f, 50);}
I hope this will help you!