The JSon method is always returning a simple array:
["First","Second"]
Do I need to parse it? I tried but it does not work.
I then tried:
$("#Subjects").autocomplete("GetSubjects", {
autoFill: true,
cacheLength: 1,
multiple: true,
scrollHeight: 200,
selectFirst: false,
width: 260
});
But it does not work to.
Any idea?
Thanks,
Miguel
On Jul 22, 1:02 am, shapper <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a JQuery AutoComplete thats gets the value using JSon.
> Using Firebug I see that the values are being returned in the right
> way:
>
> ["First","Second"]
>
> But I get an error:
> value is undefined
> highlight()()JQuery.A...mplete.js (line 409)
> fillList()JQuery.A...mplete.js (line 648)
> display()()JQuery.A...mplete.js (line 666)
> receiveData()JQuery.A...mplete.js (line 316)
> success()()JQuery.A...mplete.js (line 355)
> success()JQuery.js (line 2818)
> onreadystatechange()()JQuery.js (line 2773)
> [Break on this error] return value.replace(new RegExp("(?![^...^&;]
> +;)", "gi"), "<strong>$1</strong>");
>
> My AutoComplete is as follows:
>
> $("#Subjects").autocomplete("GetSubjects", {
> autoFill: true,
> cacheLength: 1,
> multiple: true,
> scrollHeight: 200,
> selectFirst: false,
> width: 260,
> parse: function(data) {
> return $.map(eval(data), function(row) {
> return {
> data: row,
> value: row.Value,
> result: row.Value
> }
> });
> },
> formatItem: function(item) {
> return item.Value;
> }
> });
>
> What am I doing wrong?
>
> Thanks,
> Miguel