As the Title suggests I want to be able to reduce the amount of suggestions that autocomplete recommends as i'm finding that even with minLength being set to 3 there are still far too many values being suggested. I have tried setting maxItemsToShow: and max: but neither have worked for me.
Ideally I'd like to be able to type in a few characters and have autocomplete suggest 5 values with a scroll bar to sift through the additional suggestions (if possible).
$(function() {
$( "#step" ).autocomplete({
source: '${g.createLink(controller: 'templateStep', action: 'suggestedStepValues')}',
minLength: 3,
max: 5
});
Any ideas on how to achieve this?
EDIT*
Here is my input field:
<div class="form-group col-md-3">
<label for="step">
<g:message code="templateStep.step.label" default="Step" />
</label>
<g:textField name="step" class="form-control" maxlength="250" required="" value="${templateStepInstance?.step}"/>
</div>
Here is my script function:
$(function() {
$( "#step" ).autocomplete({
source: '${g.createLink(controller: 'templateStep', action: 'suggestedStepValues')}',
minLength: 3
});