Solved

Add Search or Filter to CFGrid

Posted on 2010-11-29
5
841 Views
Last Modified: 2012-06-21
I attached my Grid below.  Its pretty simple one.  I would like to add a search to it. Anyone have any experience doing this please help me out.

I attached my Grid below.
<cfform name="CouponForm">

<cfgrid name="parkGrid" selectmode="row" format="HTML" pagesize="8" width="585" bind="cfc:listCoups.getParks({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">

                <cfgridcolumn name="Cid" header="id" display="no">

                <cfgridcolumn name="businessName" width="185" header="Business Name" href="detailcoupon.cfm" hrefkey="id"/>

                <cfgridcolumn name="cDescription" width="200" header="Coupon" />

                <cfgridcolumn name="city" width="80" header="City" />

                <cfgridcolumn name="NEWexpDate" width="200" header="Exp Date" />

              </cfgrid>

            </cfform>

Open in new window

0
Comment
Question by:sonicimpulse
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:RickEpnet
Comment Utility
Hmmm you can do this through a CFC. I am sure agx will help you.
0
 
LVL 14

Accepted Solution

by:
RickEpnet earned 500 total points
Comment Utility
Add a cfinput to the HTML page

<cfinput type="text" name="searchfield">

In your CFC function add this to the top of the arguments.

<cfargument name="searchfield" required="yes">

Add a "where" statement to the query or add the searchfield to the "where" statement.


bind="cfc:listCoups.getParks({searchfield@keyup},{cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"

Open in new window

0
 

Author Comment

by:sonicimpulse
Comment Utility
I get the following error:

You cannot specify more arguments to a CFC function than it declares.  
Error parsing bind cfc:listCoups.getParks({searchfield@keyup},{cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})  
0
 
LVL 14

Expert Comment

by:RickEpnet
Comment Utility
Did you add this to above all you cfc arguments in that cfc function?

<cfargument name="searchfield" required="yes">

Where do you get the error when you start typing in the search box?
0
 

Author Closing Comment

by:sonicimpulse
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Read about why website design really matters in today's demanding market.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now