I am working with MS Dynamics CRM 2013 and I am facing with the issue that when I want to add event handler to the button "Documents" in the navigation pane,
jQuery function .on() doesn't work with "click" event. It works fine with "mouseover" or "mouseup" events, but does not work with "click". Here is code, that I'm using:
$("#crmMasthead").on( "click", "#Node_navDocument", function(){ alert("Success!"); } );
Where:
#crmMasthead - static selector;
#Node_navDocument - id of the button "Documents", that I want to reload.
Please help me with this issue. Thank you in advance!
EDIT
Here is html which I am dealing with:
Before user opens navigation pane in CRM 2013:
<body>
...
<div id="crmMasthead" tabindex="-1">
<div class="navStatusArea" id="navStatusArea"></div>
<div class='navBar' id='navBar'>...</div>
<div class="navBarOverlay" id="navBarOverlay" style="display: none;"> </div>
</div>
...
</body>
User has just opened navigation pane in CRM 2013:
<body scroll="no">
...
<div id="crmMasthead" tabindex="-1">
<div class="navStatusArea" id="navStatusArea"></div>
<div class='navBar' id='navBar'></div>
Changed:<div class="navBarOverlay" id="navBarOverlay" style="display: block;"></div>
New: <div class="navActionGroupContainer" style="">
...
<a class="navActionButtonContainer navActionButton navActionButtonDefault normal " id="Node_navDocument" role="button" title="Documents" href="javascript:;" unselectable="on" style="background-color: #555555">...</a>
...
</div>
</div>
...
</body>
Node_navDocument
is child ofcrmMasthead
? If not replacecrmMasthead
withdocument
/respective parent element. – Unknownmouseup
, why not use that instead ? Something is probably blockingclick
events if other events are working. – adeneo