Showing posts with label Button. Show all posts
Showing posts with label Button. Show all posts

Sunday, 29 April 2012

Dojo Back Button Header On Click event handler

Dojo Back Button Header (Navigation Button) by Default has MoveTo or Href as the possible attributes which we can set.

If we need to add a EventListner to Back Button of the Header panel its not possible so easily...

The Simplest Work around to capture the Events fired by back button in the Header is as given below.

The Highlighted text in Green is the Container tags for Back button with respective Classes for Back button.

The Script below is the function which will be called once the Back button is clicked.


<h1 data-dojo-type="dojox.mobile.Heading" label="Header Title Goes Here....">
                 <div id="backButtonId" class="mblArrowButton" style="width: 67px;"     onclick="customClickHandler()">
                      <div class="mblArrowButtonHead"></div>
                      <div class="mblArrowButtonBody mblArrowButtonText">Back</div>
                   </div>
</h1>



<script>
function customClickHandler()
{
       alert("Back Button Clicked");
}
</script>