Solved

Angular grid filter

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now