CAutoComplete disturbing my other ajax calls

Hello guys. I am trying to use CAutocomplet. I use this link http://www.yiiframework.com/wiki/25/ to understand ho it works.

But after that it disturbs other ajax calls like enableAjaxValidation calls and others too…

I figure out that jquery.ajaxqueue.js file is the one, disturbing all calls and i found it in assets. I can’t remove it manually too. And I have no idea what this file is doing with autocomplete because after deleting this file everything starts working fine also the autocomplete.

need some help here…

Anybody??

Can you post the resulting javascript?


/*<![CDATA[*/

jQuery(function($) {

jQuery("#email-tb").legacyautocomplete("/yii_imp/index.php/multipleEmails/autoCompleteLookup",{'minChars':2,'delay':500,'matchCase':false,'max':10});

});

/*]]>*/

This below file is automatically loading when I use CAutocomplete


<script type="text/javascript" src="/yii_imp/assets/bf9c0a0d/jquery.ajaxqueue.js"></script>

but when i manually delete its code from asset everything start working fine.

Code in that file is




(function($) {

	

	var ajax = $.ajax;

	

	var pendingRequests = {};

	

	var synced = [];

	var syncedData = [];

	

	$.ajax = function(settings) {

		// create settings for compatibility with ajaxSetup

		settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));

		

		var port = settings.port;

		

		switch(settings.mode) {

		case "abort": 

			if ( pendingRequests[port] ) {

				pendingRequests[port].abort();

			}

			return pendingRequests[port] = ajax.apply(this, arguments);

		case "queue": 

			var _old = settings.complete;

			settings.complete = function(){

				if ( _old )

					_old.apply( this, arguments );

				jQuery([ajax]).dequeue("ajax" + port );;

			};

		

			jQuery([ ajax ]).queue("ajax" + port, function(){

				ajax( settings );

			});

			return;

		case "sync":

			var pos = synced.length;

	

			synced[ pos ] = {

				error: settings.error,

				success: settings.success,

				complete: settings.complete,

				done: false

			};

		

			syncedData[ pos ] = {

				error: [],

				success: [],

				complete: []

			};

		

			settings.error = function(){ syncedData[ pos ].error = arguments; };

			settings.success = function(){ syncedData[ pos ].success = arguments; };

			settings.complete = function(){

				syncedData[ pos ].complete = arguments;

				synced[ pos ].done = true;

		

				if ( pos == 0 || !synced[ pos-1 ] )

					for ( var i = pos; i < synced.length && synced[i].done; i++ ) {

						if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error );

						if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success );

						if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete );

		

						synced[i] = null;

						syncedData[i] = null;

					}

			};

		}

		return ajax.apply(this, arguments);

	};

	

})(jQuery);



It is true that CAutocomplete requires ajaxqueue… is very weird… Have you checked the console? What does it say? What about XHR requests?

Have you also considered the CJuiAutocomplete instead? http://www.yiiplayground.cubedwater.com/index.php?r=UiModule/jui/ziiAutocomplete

Cheers

Thanx dude :) CJuiAutocomplete is working good for my requirement :)