ajax change event

ajax change event

  
I like to bind to the outsystems ajaxsend event. Is there a way? The code below does not seem work.

Best regards,
Niek Oosterbeek.

$(document).bind("ajaxSend", function(){
   $('.SaveAllButton').attr("disabled","disabled");
 });

For 3 years you and likely others have been waiting for an answer.

I ran into the same issue and searched the web for help finding your thread, so I'll post here the solution I eventually discovered through the javascript debugger in the browser. OutSystems uses their own internal copy of jQuery, so the events are fired as part of that entity. That means putting event handlers on the main $(document) won't work, you have to put them on the internal jQuery object OS is using. You do that like this:

outsystems.internal.$( document ).ajaxComplete(function() {
      console.log('outsystems.internal.$( document ).ajaxComplete(); ran.');
});

outsystems.internal.$( document ).ajaxSend(function() {
      console.log('outsystems.internal.$( document ).ajaxSend(); ran.');
});


There are more events and documentation on these here:

https://api.jquery.com/category/ajax/global-ajax-event-handlers/