* suggestions: Suggestions to display
* Type: Array of strings
* maxRows: Maximum number of suggestions to display at one time
- * Type: Number, Range: 1 - 100, Default: 7
+ * Type: Number, Range: 1 - 100, Default: 10
* delay: Number of ms to wait for the user to stop typing
* Type: Number, Range: 0 - 1200, Default: 120
* cache: Whether to cache results from a fetch
context.data.$textbox,
val,
function ( suggestions ) {
+ suggestions = suggestions.slice( 0, context.config.maxRows );
context.data.$textbox.suggestions( 'suggestions', suggestions );
if ( context.config.cache ) {
cache[ val ] = {
timestamp: +new Date()
};
}
- }
+ },
+ context.config.maxRows
);
}
}
}
}
} else {
- $.suggestions.highlight( context, selected, true );
-
if ( typeof context.config.result.select === 'function' ) {
// Allow the callback to decide whether to prevent default or not
if ( context.config.result.select.call( selected, context.data.$textbox ) === true ) {
result: {},
$region: $( this ),
suggestions: [],
- maxRows: 7,
+ maxRows: 10,
delay: 120,
cache: false,
cacheMaxAge: 60000,