Stumped on this spacing issue:
Have an auto complete down down menu that shows the symbol and company name of a stock (code below).
I would expect the output to be like this in the drop down
A Agilent Technologies
AA American Airlines
But it appears like this:
A Agilent Technologies
AA American Airlines
A, AA are symbols in this example.
If I used a character instead of a space, say I used '-', it appears fine; properly aligned.
Is there something with how spaces appears in drop down options that is causing this?
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
var symbol_len = symbol.length;
var name_len = name.length;
if(parseInt(symbol_len) < 15) {
var diff = 15 - parseInt(symbol_len);
for(var x=0; x<diff; x++){
symbol = symbol.concat(' ');
}
}
symbol = symbol.replace(/ /g, '\u00a0');