Sha256: 9d9744f13c5b3920ba7bcda306626edf452d1fe7568773fea8541c524562b7cd

Contents?: true

Size: 581 Bytes

Versions: 3

Compression:

Stored size: 581 Bytes

Contents

initAutoComplete = function(){
	
	autocomplete_fields = $(".<%= AUTOCOMPLETE_SELECTOR %>")
	autocomplete_fields.each(function(){
		// Datenzusammensuchen
		target = "<%= AUTOCOMPLETE_SOURCE_URL %>" + $(this).attr("<%= AUTOCOMPLETE_DATA_VALUE %>") 
		div_id = "#"+$(this).attr("id")
		
		loadAutoCompleteJSONData(div_id, target);	
		
	});
	
}

loadAutoCompleteJSONData = function(div_id, target){
	$.getJSON(target, function(data){
		source_data = []
		$.each(data, function(id, val){
			source_data.push(val);
		});
		
		$(div_id).autocomplete({
			source: source_data
		});
	});
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
friends_ajax_core-0.0.55 app/assets/javascripts/ajax_ui_core/autocomplete.js.erb
friends_ajax_core-0.0.52 app/assets/javascripts/ajax_ui_core/autocomplete.js.erb
friends_ajax_core-0.0.51 app/assets/javascripts/ajax_ui_core/autocomplete.js.erb