TYPEAHEAD PROBLEM

5 replies · opened Jun 10, 2016

MMikeJun 10, 2016

HELLO GUYS
I ALREADY ASKED YOU THIS A WEEK AGO AND YOU TOLD ME YOUR ANSWER ALREADY BUT I AM ALMOST SURE WE MISSED SOMETHING

ON MY FORM THERE IS AN AUTOFILL TYPEHEAD FORM THIS IS CALLED MARQUE

I SAID SOMETHING IS WRONG AND YOU SAID IT IS BECAUSE IT IS IN ALPHABETICAL ORDER

BUT PLEASE CHECK IT AGAIN BECAUSE IT SEEMS TO BE A BUG

PLEASE GO ON MY URL AND TRY TO FIND THE BRAND RENAULT BY TYPING IT

WHEN YOU ENTER THE FIRST LETTER R THE BRANDS THAT START WITH A R SHOULD APPEAR FIRST, ITS NOT THE CASE

HOW TO JUSTIFY THAT BRABUS CHEVROLET AND CHRYSLER APPEAR WHEN I TYPE ONLY R LETTER AND THAT RENAULT WONT EVEN APPEAR ON THE WHOLE LIST ? PLEASE TRY IT ON THE URL IN NEXT POST ITS REALLY WEIRD THANKS

SSemicolon WebSTAFFJun 13, 2016

Hello,

Actually, this is the Default Functionality of the Typeahead Plugin. However, we too agree with you that this should not work the way it is working currently. So, we have created another code for you using the Bloodhound addon. Please replace your Existing Typeahead JS Code at the bottom of the Page with the following code:


	var marquesdata = ['ALFA ROMEO', 'ASTON MARTIN', 'AUDI', 'BENTLEY', 'BMW', 'BRABUS', 'BUGATTI', 'BUICK', 'CADILLAC', 'CHEVROLET', 'CHRYSLER', 'CITROEN', 'CORVETTE', 'DACIA', 'DAEWOO', 'DAIHATSU', 'DODGE', 'FERRARI', 'FIAT', 'FORD', 'HONDA', 'HUMMER', 'HYUNDAI', 'ISUZU', 'IVECO', 'JAGUAR', 'JEEP', 'KIA', 'LADA', 'LAMBORGHINI', 'LANCIA', 'LAND ROVER', 'LEXUS', 'MARUTI', 'MASERATI', 'MAYBACH', 'MAZDA', 'MERCEDES', 'MINI', 'MITSUBISHI', 'NISSAN', 'OPEL', 'PEUGEOT', 'PIAGGIO', 'PONTIAC', 'PORSCHE', 'PROTON', 'RENAULT', 'ROLLS ROYCE', 'ROVER', 'SAAB', 'SEAT', 'SKODA', 'SMART', 'SUBARU', 'SUZUKI', 'TOYOTA', 'VOLKSWAGEN', 'VOLVO', 'AUTRE'];

	var marques = new Bloodhound({
	  datumTokenizer: Bloodhound.tokenizers.whitespace,
	  queryTokenizer: Bloodhound.tokenizers.whitespace,
	  // `states` is an array of state names defined in "The Basics"
	  local: marquesdata
	});

	$('.typeahead').typeahead({
	  hint: true,
	  highlight: true,
	  minLength: 1
	},
	{
	  name: 'MARQUES',
	  source: marques
	});

This should definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

MMikeJun 13, 2016

this is for sure how it should work, and now its works PERFECT its amazing thanks

MMikeJun 13, 2016

HELLO
YOU GAVE ME A FIX FOR THE TYPEHEAD AND IT WORKS GREAT BUT SOMETHING IS STILL TO CHANGE PLEASE
WHEN YOU TYPE R NOW RENAULT APPEARS
BUT THE BRANDS IN TWO WORDS LIKE LAND ROVER OR ALFA ROMEO APPEAR BEFORE RENAULT AND THEY SHOULD APPEAR AFTER ACTUALLY
CAN YOU TELL ME HOW TO FIX THIS PLEASE :)
THANKS !!!!!!!!!!!

SSemicolon WebSTAFFJun 13, 2016

Hello,

We too have noticed this but we feel that this is now working correctly. Please notice that the ALFA ROMEO and LAND ROVER in the Typeahead List contain 2 different Words (eg. ALFA & ROMEO) and when you type the R Letter, the Results appear in Alphabetical Order. When you join these 2 words together, Renault will appear first. This is the Default Functionality. You can check more Examples here: https://twitter.github.io/typeahead.js/examples/ .

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard