Solved

Angular grid filter

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

810 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