monosyth
asked on
Number of suggestions in an autosuggest list
I have used Ben Forta's example of creating an autosuggest list using a CFC. The default of returns seem to be 10 items. How do I change that to a different number?
<cfinput
type="text"
autosuggest="cfc:titles.getTitles({cfautosuggestvalue})"
name="title"
class="theInput"
size="70"
value=""
maxlength="70"
>
check the query in the cfc itself
ASKER
Here is the CFC code...
<cfcomponent>
<!--- FUNCTION get list of titles --->
<cffunction name="getTitles"
access="remote"
returntype="array"
output="false"
hint="Get Prospective Titles for Ajax AutoSuggest">
<cfargument name="search"
type="any"
required="false"
default="">
<!--- define variables --->
<cfset var data="">
<cfset var result=ArrayNew(1)>
<!--- get data --->
<cfquery name="data" datasource="#Application.dsn#">
SELECT Title
FROM AptTitles
WHERE UCase(Title) LIKE UCase('#ARGUMENTS.search#%')
ORDER BY Title
</cfquery>
<!--- and return it --->
<cfloop query="data">
<cfset ArrayAppend(result, Title)>
</cfloop>
<cfreturn result>
</cffunction>
</cfcomponent>
I think that 10 items returns because of the condition specified , you can test that by using query analyzer
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you, I knew it was something obvious like this...