Hi All,

I know that this posting is somehat off the subject,
but I just finding reading Friday issue of Dev Web Pro
article (8.10.07), and I throught you all might enjoy
reading about CF8 Grid Row usagese;

Reacting To Grid Row Selection In Coldfusion 8

By Raymond Camden

This week must be grid week. First we have Bruce
Phillips' post on cfgrid, and Todd Sharp posted on it
as well.

I thought I'd follow the crowd and share a tip as
well. How do you do something (anything) when a user
clicks on a grid, specifically when using the new HTML
cfgrid in ColdFusion 8? 

Technically there isn't a attribute that you can add
to the grid itself. However, other form fields can
easily bind to the grid itself. So if you wanted to
build an edit form, for example, that is pretty easy
(and again, see Bruce Phillips' post). But what if you
wanted more fine grained control? This is where
CFAJAXPROXY comes in. 

Now if you are like me - you looked at the docs on
CJAJAXPROXY and were impressed with how cool it is to
be able to create a connection to a CFC. That's
amazing, and in my mind, I think it is the most
impressive new feature in ColdFusion 8. 

But what people may miss (I know I did!) is that
CFAJAXPROXY has a whole other... "mode" we shall call
it, that lets the tag act in a complete separate
manner. In fact, it is so different I'm not quite sure
why another tag wasn't made, like CFBIND for example.
This other mode takes one main attribute, bind. You
can also use a onSuccess and onError attribute. In
this mode, the tag simply acts as a listener. So image
my grid is named entries. I can bind to it like so: 

All this says is - when the grid changes - call a
JavaScript function and pass the value of the Title
column. I could also use a CFC or CFM bind as well,
but you get the idea. Again, I think CFBIND would be a
better name since in this form the tag isn't creating
a proxy object for a remote CFC. But that's neither
here nor there - lets get back to the original
question - how do I react to a grid change? 

First you need to figure out what values you want. In
my code sample above, I grabbed the title column. If I
wanted something different, like ID, I'd do:

In this example I'm loading up my HTML grid with a
query (yes, you don't have to use Ajax for HTML
grids). On the top of my template I bound my
JavaScript function to the entries grid. Whenever I
selected an entry in my grid, an alert will be fired. 

I want to point out one last thing. Take a look at the
first cfgridcolumn. Why do I have a column that I
don't bother displaying? When you specify the columns
to show - you are also limiting the data actually
stored in the grid. If I didn't have that hidden
column there, I wouldn't be able to use the ID column
in my bind. 


--- Eli Sanders <[EMAIL PROTECTED]> wrote:

> Me too 2 1/2 yrs
> 
> On 8/10/07, Kevin <[EMAIL PROTECTED]> wrote:
> >
> >  Me too.
> >
> >
> >
> >
> >
> >
>
--------------------------------------------------------
> >
> >
> >
> > Kevin Fricke
> >
> > Lone Star Media
> >
> > [EMAIL PROTECTED]
> >
> > Office: (512) 371-1822
> >
> > Mobile: (512) 626-0528
> >
> > Fax: (512) 597-0909
> >
> > Toll Free: (877) 791-7083
> >
> >
> >
> > http://www.lonestarmedia.com
> >
> >
> >
> >
> >
> >
> >
> > *From:* [EMAIL PROTECTED] [mailto:
> > [EMAIL PROTECTED] *On Behalf Of *Brad
> Dardaganian
> > *Sent:* Friday, August 10, 2007 11:27 AM
> > *To:* [email protected]
> > *Subject:* [DFW CFUG] eSportsPartners
> >
> >
> >
> > Does anyone know about this company
> (eSportsPartners)?  Do you work there
> > or have you?  Know anyone who does?
> >
> >
> >
> > I know they're looking for developers and I would
> like to know a bit more
> > about the company and the work environment from
> someone in the know.
> >
> >
> >
> > Thanks in advance.
> >
> > _______________________________________________
> > Reply to DFWCFUG:
> >  [email protected]
> > Subscribe/Unsubscribe:
> > 
>
http://lists1.safesecureweb.com/mailman/listinfo/list
> > List Archives:
> >   
> http://www.mail-archive.com/list%40list.dfwcfug.org/
> >  http://www.mail-archive.com/list%40dfwcfug.org/
> > DFWCFUG Sponsors:
> >  www.instantspot.com/
> >  www.teksystems.com/
> >
> >
> > _______________________________________________
> Reply to DFWCFUG: 
>   [email protected]
> Subscribe/Unsubscribe: 
>  
>
http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archives: 
>    
> http://www.mail-archive.com/list%40list.dfwcfug.org/
>             
>   http://www.mail-archive.com/list%40dfwcfug.org/
> DFWCFUG Sponsors: 
>   www.instantspot.com/
>   www.teksystems.com/
> 



       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.instantspot.com/
  www.teksystems.com/

Reply via email to