I found it :
in fact I had to replace "if (data && data.length)" by "if (data)"
and now it's working with empty results.

Shouldn't it be the appopriate behaviour ?


On Sep 3, 2:47 pm, mathieuuu <mathie...@gmail.com> wrote:
> Does somebody has any idea ?
>
> On 31 août, 15:28, mathieuuu <mathie...@gmail.com> wrote:
>
> > Hi,
>
> > Thanks for your answer rupak but I tried your fix and it did not give
> > the expected result.
> > On the contrary, now I think that the plug in is no longer using
> > cache, even for non-empty results...
>
> > On 31 août, 13:58, rupak mandal <rupakn...@gmail.com> wrote:
>
> > > Hi ,
> > > you have to make a little changes in autocomplete.js
>
> > > Search for "*if (data && data.length*)" condition which is inside 
> > > "request"
> > > function. Add this code before the *if * condition
>
> > > if(data)
> > >     data.length=0;
>
> > > Thanks
> > > Rupak
>
> > > On Mon, Aug 31, 2009 at 3:36 PM, mathieuuu <mathie...@gmail.com> wrote:
>
> > > > Hello,
>
> > > > I am currently using the jquery autocomplete ($Id:
> > > > jquery.autocomplete.js 5785 2008-07-12 10:37:33Z) with remote data.
>
> > > > Obviously I did not disabled the cache and "matchSubset" option (all
> > > > matches of "foot" are a subset of all matches for "foo"), which
> > > > reduces the number of queries made to the server.
>
> > > > This is working well except in one case : if "foo" returns an empty
> > > > result set, continue by typing "foot" will still generate another
> > > > query to the server ...
> > > > From my point of view this shouldn't be useful (if "foo" doesn't
> > > > return results, "foot" won't either) and I am looking for a way to
> > > > have the same "cache usage" with empty result as with not-empty
> > > > results.
>
> > > > Does anyone have an idea of how this could be done or knows the reason
> > > > why there is this difference of behaviour ?
>
> > > > Thank you a lot for your help.

Reply via email to