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
feat(pat-autosuggest): Add batching support for AJAX requests.
This PR introduces three new options for that:
max-initial-size: Defines the batch size for the initial request (default: 10).
ajax-batch-size: Defines the batch size for subsequent requests (default: 10).
ajax-timeout: Defines the timeout in milliseconds before a AJAX request is submitted. (default: 400).
Ref: scrum-1638
| index | The optional search index to be used on the server, if needed. |
66
+
| q | The search term. |
67
+
| page_limit | The number of items to be returned per page. Based on the current page it is wether `max-initial-size` (page 1) or `ajax-batch-size` (page 2). |
68
+
| page | The current page number. |
69
+
37
70
### Option reference
38
71
39
72
You can customise the behaviour of a gallery through options in the `data-pat-auto-suggest` attribute.
| ajax-batch-size | Number | 10 | Batch size for subsequent pages of a bigger batch. For the first page, `max-initial-size` is used. |
43
77
| ajax-data-type | String | "json" | In what format will AJAX fetched data be returned in? |
44
78
| ajax-search-index | String || The index or key which must be used to determine the value from the returned data. |
79
+
| ajax-timeout | Number | 400 | Timeout before new ajax requests are sent. The default value is set ot `400` milliseconds and prevents querying the server too often while typing. |
45
80
| ajax-url | URL || The URL which must be called via AJAX to fetch remote data. |
46
81
| allow-new-words | Boolean | true | Besides the suggested words, also allow custom user-defined words to be entered. |
82
+
| max-initial-size | Number | 10 | Initial batch size. Display `max-initial-size` items on the first page of a bigger result set. |
47
83
| max-selection-size | Number | 0 | How many values are allowed? Provide a positive number or 0 for unlimited. |
48
84
| placeholder | String | Enter text | The placeholder text for the form input. The `placeholder` attribute of the form element can also be used. |
49
85
| prefill | List || A comma separated list of values with which the form element must be filled in with. The `value-separator` option does not have an effect here. |
0 commit comments