You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/widgets/hits/hits.js
+12-5
Original file line number
Diff line number
Diff line change
@@ -14,23 +14,26 @@ import defaultTemplates from './defaultTemplates.js';
14
14
* @param {string|DOMElement} options.container CSS Selector or DOMElement to insert the widget
15
15
* @param {Object} [options.templates] Templates to use for the widget
16
16
* @param {string|Function} [options.templates.empty=''] Template to use when there are no results.
17
-
* @param {string|Function} [options.templates.item=''] Template to use for each result.
17
+
* @param {string|Function} [options.templates.item=''] Template to use for each result. This template will receive an object containing a single record.
18
+
* @param {string|Function} [options.templates.allItems=''] Template to use for each result. (can't be used with item template). This template will receive a complete SearchResults result object, this object contains the key hits that contains all the records retrieved.
18
19
* @param {Object} [options.transformData] Method to change the object passed to the templates
19
20
* @param {Function} [options.transformData.empty=identity] Method used to change the object passed to the empty template
20
21
* @param {Function} [options.transformData.item=identity] Method used to change the object passed to the item template
22
+
* @param {Function} [options.transformData.allItems=identity] Method used to change the object passed to the item template
21
23
* @param {number} [hitsPerPage=20] The number of hits to display per page
22
24
* @param {Object} [options.cssClasses] CSS classes to add
23
25
* @param {string|string[]} [options.cssClasses.root] CSS class to add to the wrapping element
24
26
* @param {string|string[]} [options.cssClasses.empty] CSS class to add to the wrapping element when no results
25
27
* @param {string|string[]} [options.cssClasses.item] CSS class to add to each result
0 commit comments