Solved

Angular grid filter

Posted on 2016-08-07
1
53 Views
Last Modified: 2016-11-30
Hi Experts, I would like to know about the best approach to make a grid filter, like the one used in sites like eBay or Aliexpress: a list of categorys and ranges on the sidebar, that filters a grid on the content space.
I've recently build one, using two controllers, and messages , when user selects an item filter, it publish a message, and the grid controller, suscribed to notification, updates the filter, but in other post I've readed that could be done using a service to share the same data between controllers.
It would be great to see some example (plunkr, jsfiddle, etc) or github source code.
Best regards
0
Comment
Question by:MarianoSB
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41901922
Hi Experts, I would like to know about the best approach to make a grid filter, like the one used in sites like eBay or Aliexpres s: a list of categorys and ranges on the sidebar
you create a service to get data using a keyword (word or part on word). in the backd the service use ajax to query the database which use the keyword to do the request : SELECT id, name, code, price, description FROM products where name like '%keyword%'

, that filters a grid on the content space.
each time you click on the search button, the keyword is updated and the service do a new call and update the $scope.products

I've recently build one, using two controllers, and messages , when user selects an item filter, it publish a message, and the grid controller, suscribed to notification, updates the filter, but in other post I've readed that could be done using a service to share the same data between controllers.

if both controllers are child of a third one, just set the search(keyword) and products list in this top/parent controller.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You have this traditional web application that refreshes the whole page each time you navigate and you think it's a good time to convert it to a Single-Page approach. What should you know in advance? Read on, I'll guide you through it.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question