-
Notifications
You must be signed in to change notification settings - Fork 211
Architecture: Widgets
- Architectural overview
- Manager
- Parameters
- Widgets
Widgets inspect the JSON response retrieved from Solr by the Manager and update the interface accordingly.
AbstractWidget is the base class from which all other widgets inherit. Every widget takes a required id, to identify the widget, and an optional target. target is usually the CSS selector for the HTML element that the widget updates after each Solr request.
AbstractWidget defines three abstract methods: init, called by the Manager’s init method, performs one-time initializations; beforeRequest is called by the Manager’s doRequest method before the request is sent to Solr; and afterRequest is called by the Manager’s handleResponse method after a response is received from Solr.
AJAX Solr defines abstract widgets to get you started writing your own widgets. To benefit from the convenient functions contained in these widgets, you need only write a new widget inheriting from one of these widgets.
These abstract widgets include:
- AbstractFacetWidget for widgets that manipulate the fq parameter
- AbstractTextWidget for widgets that manipulate the q parameter
- AbstractSpellcheckWidget for widgets that handle the spellcheck data in the Solr response
- AbstractSpatialWidget for widgets that manipulate the Spatial Solr local parameters
- PagerWidget for widgets that perform pagination (jQuery-only)