Welcome Guest, Not a member yet? Register   Sign In
Parallel Filtering for a CodeIgniter web site
#1

[eluser]bazianm[/eluser]
Many sites have what they call Parallel Filtering. The best examples I can think of are e-commerce sites. Pricegrabber.com has it as does Kayak.com just to name two of many. Basically, you do a search and wind up with a data set. Them you put together search criteria that you list on the left (e.g., Price and then you have checkboxes for <100, 100-200, 200-300, then perhaps vendor, age, whatever) that you use to select filter criteria. When you click on a filter criteria, it filters the data automatically. You sort the results with a drop down of sort options.

Like I said, this is implemented on many sites.

I have a codeigniter site that needs this type of functionality. I am hoping there is something out there that I can use to give me a leg up on this.

Any recommendations would be appreciated.
#2

[eluser]CroNiX[/eluser]
It's just a form, and when items are changed on the form it fires off an ajax request to the server. The server takes the form values and builds a sql query and queries the db, returning the results, either in json or html format. If json, it builds the html once the browser receives the data. Then the onSuccess event of the ajax request takes the returned data and replaces the html on the page, usually within a div, with the new results.
#3

[eluser]bazianm[/eluser]
Thanks for the reply.

I get that. I still was hoping for something canned because there are a lot of moving parts. For example, when a user clicks on a filter criteria, it gets added to the top to show that the current criteria is. Then there is the calculation of what the filter criteria should be... frequently it's based on the data set itself. I am not thinking this is super difficult, just that there is a lot and I am hoping to save time.
#4

[eluser]CroNiX[/eluser]
I getcha. However, I think the reason why I've never seen a package/library for ANY framework that does this is exactly what you said..."a lot of moving parts". The requirements for each search/filter situation are really unique to that project, so something generic just wouldn't work.

Like, does this checkbox include or exclude from the results. I have filter forms that have both. These queries can be quite complex depending on the number of filter options you allow, whether they are inclusive or exclusive, along with how many tables need to be joined, etc. It doesn't really take long to roll your own, though. Just be sure your DB is properly indexed Smile
#5

[eluser]CroNiX[/eluser]
I also use a jquery debounce function and set it to 1.25 seconds, so that it will only fire off an ajax request if there isn't any change to the filter form for that length of time. Otherwise, as the person is going down the list checking various checkboxes, it fires off way to many requests (one for each click/change to the form)




Theme © iAndrew 2016 - Forum software by © MyBB