Yii Framework Forum: Uncaught Typeerror: Object Has No Method Autocomplete And Its Blocking To Populate Dialogue Box To Delete In Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Uncaught Typeerror: Object Has No Method Autocomplete And Its Blocking To Populate Dialogue Box To Delete In Yii Rate Topic: -----

#1 User is offline   developer! 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 110
  • Joined: 28-November 12

Posted 24 January 2013 - 11:40 AM

I'm sorry similar post is already there in the community, But i'm finding it strange. Its working fine but it affected my other views and not allowing other view pages to populate any dialogue boxes..

I tried to fix it by wrapping it in function() like this

$('#_auto').autocomplete(function(){

But, with this i'm not getting jason values in the _auto textfield and getting unexpected token error with following line.
can anyone help me to solve this please.

source: function(request,response){


this is my code:

$(function () {
		$('#_auto').autocomplete({
			selectFist: true,
			minLength: 2,
			source: function (request, response) {
				var sval = $('#_auto').val();
				//alert(sval);
				$.ajax({
					url: BASE_URL + '/controller/search/',
					type: 'POST',
					data: {
						'term': sval,
					},
					dataType: 'json',
					success: function (data) {
						console.log(data);
						var dta = [];
						orgdetails = [];
						//response(data.d);
						for (var i in data) {
							dta.push(data[i].name);
							orgdetails[data[i].name] = data[i].id;
						}
						response(dta); //response(dta);
					},
					error: function (result) {}
				}); //ajax
			}
		}).focus(function () {
			$(this).trigger('keydown.autocomplete');
		});
	});


Many Thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users