Prototype js onComplete not working for sortable

41 views
Skip to first unread message

Max

unread,
Dec 23, 2016, 12:53:19 PM12/23/16
to Prototype & script.aculo.us
Hi everybody. I am using prototype js and scriptaculous sortable but when i do an oncomplete alert or anything, it does not work
Here is mycode

<script>
		Event.observe(window,'load',init,false);
		function init() {
			Sortable.create('listContainer',{tag:'div',onUpdate:updateList});
		}
		function updateList(container) {
			var url = 'ajax.php';
			var params = Sortable.serialize(container.id);
			var ajax = new Ajax.Request(url,{
				method: 'post',
				parameters: params,
				onLoading: function(){$('workingMsg').show()},
				onLoaded: function(){$('workingMsg').hide()},

onComplete: function(){ alert('good'); }

 }); } function handleResponse(req) { // this function will fire after the ajax request is complete...but we have nothing to do here } </script>

Everything works perfectly when i launch the function except the fact that onComplete the alert is not sent. How to fix that ?

Reply all
Reply to author
Forward
0 new messages