Problem with formatResult in autocomplete, don't work

Problem with formatResult in autocomplete, don't work


Hello,
I'm working with Symfony Framework and jquery autocomplete. The
autocomplete function works fine, but i want to custom the output
format that shows the items. I was looking the documentation and in
the configuration of jquery autocomplete I add this:
minChars: 2,
mustMatch:false,
formatItem: function(data, i, n, value){
return value[0];
},
formatResult: function(data,i,n){
alert("hello");
return data[0];
}
The data received is 'Name|Image', in formatItem I will use split to
shows an image and the name, but formatResult never executes when i
select an option and I don't know why.
Could anybody help me, please?
PD: Sorry for my English!