Is it possible to bind to the onComplete event for an <apex:commandButton/>?
Instead of using the following format:
<script>
function myOnComplete(){
// do onComplete stuff
}
</script>
<apex:commandButton action="{!myAction}" onComplete="myOnComplete();"/>
I would prefer to use jQuery to bind to the onComplete event, but have not had any luck:
<script>
var jQuery = $.noConflict(true);
jQuery(document).ready(function($){
$('.myCmdButton').on('complete', function(){
// do onComplete stuff
});
});
</script>
<apex:commandButton action="{!myAction}" styleClass="myCmdButton" />
I've also tried to use the ajaxComplete event and then check the source as I have seen suggested, but this event doesn't seem to fire...
$(document).on('ajaxComplete', function(event, xhr, options){});