Skip to content
Shakhal Levinson edited this page Dec 16, 2013 · 3 revisions

The Filter object is a utility class which helps you parse the URL query string.
It is available for use in the client side as well as on the server side.

Usage example in client side:

URL in example: http://open-pension.herokuapp.com/?managing_body=Migdal&group_by=instrument_type&rating=AA&currency=NIS

var filter = Filter.fromQueryString(window.location.search);

filter.getConstrainedFields();
//output : ["managing_body", "group_by", "rating", "currency"]

filter.getConstraint("managing_body");
//output: [{"data":"Migdal"}]

filter.getConstraintData("managing_body");
//output "Migdal"

Clone this wiki locally