Topic: Sorting/Filtering a list with a Dropdown

What is the best way to do this.

I have a products table and a categories table

there is a list of products with a dropdown(select menu) at the top of the page. I want to filter the data when the user changes their selection (preferably without postback)

Any Suggestions?

Thanks a mil

Re: Sorting/Filtering a list with a Dropdown

I'm looking for an answer to this as well...

Re: Sorting/Filtering a list with a Dropdown

Let me try to understand a bit better.  When a user selects an item from the list you'd like the list to change?  Or you'd like parts of the page to change?

the javascript onChange event allows you to do just about anything when a user selects something from the list.  You can run some Ajax call, you can re-populate the select menu, or anything else you need.

If you've got a list of products on your page and you want to update it when a user selects a different category from the list then you want:

select_tag :my_select, options_for_select([1,2,3]), :onChange => remote_function(:url => 'my_url')

Re: Sorting/Filtering a list with a Dropdown

Thanks Danger,

Yes having the list change is the desired behavior.  I will
try the select_tag!

Thanks!