The solution the issue.
formatItem: function(row,position,total,searchTerm) {
// server sends rows e.g. kelantan, kedah
return row.toString().split(',')[0];
}
On Feb 3, 10:33 pm, "thomas.confuse" <[email protected]> wrote:
> Hi, Eric.
> Thanks for the response.
> but i somehow kinda "bump" into the another way of getting it done.
> trial and error . :-)
>
> Its done using formatline option in autocomplete. I will paste the
> code here very soon.
>
> On Feb 3, 10:14 pm, Eric Garside <[email protected]> wrote:
>
> > I'm not sure what kind of data autocomplete accepts, as I'm not
> > familiar with the plugin, but I assume an array of values will work.
>
> > If your Javaservletis returning "a, b, c, d" as your valuestring,
> > call:
>
> > var servletResponse = "a, b, c, d"; // Or however you get the value
> > servletResponse = servletResponse.split(', '); // Split on the
> > delimiter plus a space
> > alert(servletResponse); // [a, b, c, d];
>
> > On Feb 3, 5:13 am, "thomas.confuse" <[email protected]> wrote:
>
> > > Hi, all.
> > > i just started to use Jquery. i m using remote data to pass into
> > > jQuery widget, autocomplete.
> > > but the data from theservletis generated in this format a, b,c,....
> > > how can i break the data from theservletto populate the
> > > autocomplete ?
>
> > > Please advice.i m using java for theservletand the jsp page to for
> > > the form.