rendered paste body <cffunction name="getProducts" hint="I get all the products." access="remote" returntype="query" output="true">
<cfargument name="page" type="numeric" required="yes">
<cfargument name="pageSize" type="numeric" required="yes">
<cfargument name="gridsortcolumn" type="string" required="no" default="">
<cfargument name="gridsortdir" type="string" required="no" default="">
<cfset var local = structNew() />
<cfquery name="local.qryProducts" datasource="#request.dsn#">
SELECT *
FROM brb.products
<cfif ARGUMENTS.gridsortcolumn NEQ "" AND ARGUMENTS.gridsortdir NEQ "">
ORDER BY #ARGUMENTS.gridsortcolumn# #ARGUMENTS.gridsortdir#
<cfelse>
ORDER BY product_short_name
</cfif>
</cfquery>
<cfreturn local.qryProducts />
</cffunction>
<cfform>
<cfgrid name="products"
format="html"
pagesize="10"
striperows="yes"
bind="cfc:boardroom2.com.productManager.getProducts({cfgridpage},
{cfgridpagesize},
{cfgridsortcolumn},
{cfgridsortdirection})">
<cfgridcolumn name="product_id" display="false" />
<cfgridcolumn name="product_short_name" header="Product Short Name" width="150"/>
<cfgridcolumn name="product_long_name" header="Product Long Name" width="150"/>
<cfgridcolumn name="product_group_id" header="Group" width="100"/>
<cfgridcolumn name="prod_category_id" header="Category" width="100"/>
<cfgridcolumn name="product_code_3" header="Product Code 3" width="100"/>
<cfgridcolumn name="product_code_6" header="Product Code 6" width="100"/>
<cfgridcolumn name="default_product_offer_price" header="Def. Offer Price" width="100" />
<cfgridcolumn name="default_product_sh_price" header="Def. SH Price" width="100"/>
</cfgrid>
</cfform>