The event occurs before data loading and allows to customize filtering of dataset.
<cfset conn.event.attach("beforeFilter",handlerFunc)>
Parameters handlerFunc:
Availability:
Sample:
<cffunction name="custom_filter">
<cfargument name="filter_by">
<!--- changes WHERE some_field LIKE '%value%' to the WHERE some_field gt 'value' --->
<cfset var index=ARGUMENTS.filter_by.index("some_field") >
<!--- there is client side input for the filter --->
<cfif index>
<cfset ARGUMENTS.filter_by.rules[index]["operation"]=">">
</cfif>
</cffunction>
<cfset conn.event.attach("beforeFilter",custom_filter)>
Back to top