PDA

View Full Version : Grid filtered by search on form



spor
3 Aug 2010, 11:08 PM
I have a form and a grid. The form is a search form and the results from the search will be shown on the grid. Is there a smart way to do this?

I am not thinking regular standards filter on the grid where the end user can set filter on metadata like name, address and so on, but filter based on the search.

madkris
3 Aug 2010, 11:20 PM
How about a grid with a search toolbar?

Place a Ext.form.TriggerField on the grid's toolbar.

spor
3 Aug 2010, 11:38 PM
A search toolbar on the grid won't be sufficient. The search is based on input from multiple fields in the form. Regardless, that is how the layout will be.

Condor
4 Aug 2010, 12:16 AM
What are you looking for?

Are you looking for a way to dynamically create a search form based on the data in the grid store?
Are you asking how to filter a store (either locally or remote)?

madkris
4 Aug 2010, 4:42 PM
Are you asking how to filter a store (either locally or remote)?

Remote:
If this is the case, then I suppose you could trigger store load on form submit, but you'll have to add form values to the store's baseParams so that they'll be included as parameters when the store loads, your backend will handle the search based on the values the store baseParams passed.

Locally:
Same thing except you wont have to add the form values into the store's baseParams, instead you'll have to handle the search based on the values the form passed.

Hope it helps. :)