I'm using an HTML cfgrid to present a large number of results. I've
got a couple of cfselects that I'd like to use to filter down those
results. Is it possible to do this? Here's my code:
search.cfm:
<cfform action="#CGI.script_name#" method="get" name="search"
preservedata="true" format="html">
Category: <cfselect name="category" query="getcategories"
display="category" value="category" queryposition="below"></cfselect>
Brand: <cfselect name="brand" query="getbrands" display="brand"
value="brand" queryposition="below"></cfselect>
<br />
<cfgrid name="products" format="html" pagesize="25" sort="true"
bind="cfc:data.getAllProducts({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
<cfgridcolumn name="category" header="Category">
<cfgridcolumn name="brand" header="Brand">
<cfgridcolumn name="model" header="Model">
<cfgridcolumn name="description" header="Description">
<cfgridcolumn name="msrp" header="MSRP">
</cfgrid>
</cfform>
And data.cfc:
<cffunction name="getAllProducts" access="remote" output="false">
<cfargument name="page">
<cfargument name="pageSize">
<cfargument name="gridsortcolumn">
<cfargument name="gridsortdirection">
<cfquery name="getAllProducts" datasource="#application.dsn#">
SELECT partnumber, category, brand, model, description,
retailunit, retailuom, price, break,
breakprice, msrp, mfgrpartnumber,
lastdateofpricechange, upc, ean,
ean2, status, replacement,
replacementdescription, len, width, height,
weight, ormdstatus
FROM tblqbpcatalog
WHERE status IS NULL OR
status = 'new'
<cfif arguments.gridsortcolumn neq "" or
arguments.gridsortdirection neq "">
ORDER BY #arguments.gridsortcolumn# #arguments.gridsortdirection#
</cfif>
</cfquery>
<cfreturn QueryConvertForGrid(getAllProducts, arguments.page,
arguments.pagesize)>
</cffunction>
There's got to be a straightforward way to accomplish this, but I've
been through the docs and have found nothing.
Pete
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315349
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4