Well...I don't see anything in your code that would filter the JSON once it
comes back from the server.

You are just dumping the response into the select menu.  Once the params are
sent to the server, and the JSON is generated there, there is nothing else
that would happen to create further filtering.

The params in the getJSON function do not provide filtering for the returned
JSON, only keys/values to be passed to the server.

It seems like you might be better served doing the filtering on the server,
that way you do not have to pass back the entire list of funds, only the
ones in the category you send to the server.

-- Josh





-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of bradrice
Sent: Thursday, May 14, 2009 10:45 AM
To: jQuery (English)
Subject: [jQuery] Re: jquery.getJSON params not filtering


I have this in there:

$.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown)
{
              alert(textStatus);
              alert(errorThrown);
              alert(XMLHttpRequest.responseText);
          }});

I've got it coming back right. I can see the json on the server and it
is serving correctly.

Like I said I am getting a proper response back and it is populating
the menu, just not filtering on the params I am telling it to filter
on.

On May 14, 1:08 pm, "Josh Nathanson" <joshnathan...@gmail.com> wrote:
> I would say then that it's probably your server code.  Maybe run some
> debugging and make sure the parameters are coming in as you expect, and
look
> at the data server side before it goes back to the client.
>
> -- JOsh
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of bradrice
> Sent: Thursday, May 14, 2009 10:02 AM
> To: jQuery (English)
> Subject: [jQuery] Re: jquery.getJSON params not filtering
>
> OK, I changed it but it still returns everything. It isn't filtering.
> Thanks for the suggestion.
>
> On May 14, 12:54 pm, "Josh Nathanson" <joshnathan...@gmail.com> wrote:
> > I think your params should look like this:
>
> > { "category":fundType }
>
> > In your code, you are passing a string rather than a javascript object
> > literal.
>
> > -- Josh
>
> > -----Original Message-----
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> > Behalf Of bradrice
> > Sent: Thursday, May 14, 2009 9:38 AM
> > To: jQuery (English)
> > Subject: [jQuery] jquery.getJSON params not filtering
>
> > I just can't seem to get getJSON to filter based upon the map I send
> > in.
>
> > Here is my code:
>
> > $.getJSON('funds_static_json.dot',"{category:fundType}",function(json)
> > {
> >                         dropdownSet.loadSelect(json);
> >                 }
>
> > My post in firebug looks completely right:
>
> >http://www.uakron.edu/development2/funds/funds_static_json.dot?catego...
> > 60
>
> > The json is formatted properly and passes the lint test.
>
> > However, I get the entire json back and not the filtered by my
> > parameter. I have over a thousand funds, but it should only pull back
> > about 9 bassed upon that category.
>
> > Here is my working
> url:http://www.uakron.edu/development2/funds/fund-detail_2.dot
>
> > Any help would be appreciated. I'm slamming into a wall.

Reply via email to