Solved

Angular grid filter

Posted on 2016-08-07
1
62 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

713 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