Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Angular grid filter

Posted on 2016-08-07
1
Medium Priority
?
93 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 1500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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