I also tried the following but until now I wasn't able to make it
work:

      $("#Tags").autocomplete("/Professor/GetTags", {
        autoFill: true,
        cacheLength: 1,
        multiple: true,
        scrollHeight: 200,
        selectFirst: false,
                    width: 260,
                    formatResult: function(item) {
          return item.Name;
        }
     });

Please, does anyone knows how to do this?

MyJson data is as follows:
[{"TagID":"3fae2160-55f6-4dd0-b856-fd27f5d307e2","Name":"John"},
{"TagID":"883b197e-0cb3-4528-8403-0877d742bf47","Name":"Jane"}]

I have been trying to solve this but until now I wasn't able ...

Thanks,
Miguel


On Jul 11, 8:53 pm, shapper <[EMAIL PROTECTED]> wrote:
> Yes,
>
> I tried the following:
>
>       $("#Tags").autocomplete("/File/GetTags", {
>         width: 260,
>         formatItem: function(item) {
>           return item.Name;
>         }
>       });
>
> But this is not working. Any idea?
>
> Thanks,
> Miguel
>
> On Jul 11, 7:03 pm, tlphipps <[EMAIL PROTECTED]> wrote:
>
> > You need to use the formatResult option (I think that's the option
> > name).  It will allow you to format the data for display.
>
> > On Jul 11, 12:08 pm, shapper <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I am using JQuery AutoComplete with JSon. I created a function on my
> > > server code which return the data.
>
> > > However, when I start writing "J" in my Input I get the following:
>
> > > [{"TagID":"883b197e-0cb3-4528-8403-0877d742bf47","Name":"John"},
> > > {"TagID":"017b253e-596b-4328-85f5-fd97a783759c","Name":"Jane"}]
>
> > > How to get only the names instead of this strange format? Am I a
> > > missing something here?
>
> > > Thanks,
> > > Miguel

Reply via email to