Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfgrid question

Status
Not open for further replies.

FALCONSEYE

Programmer
Jul 30, 2004
1,158
US
I have the following:

Code:
<cfajaximport/>
<html>

<head>
<script>
      
myf = function(data,cellmd,record,row,col,store) {
   if(data == "Product 4")
	return "<b>" + data + "</b>";		
   else  return data;
}
testgrid = function() {
   mygrid = ColdFusion.Grid.getGridObject('data');
   ds = mygrid.getDataSource();
   cm = mygrid.getColumnModel();
   cm.setRenderer(0, Ext.util.Format.usMoney);
   cm.setRenderer(1,myf);
   
}

</script>
</head>

<body>

<cfset data = queryNew("price,product")>
<cfloop from=1 to=10 index="x">
   <cfset total = randRange(20,100) & "." & randRange(1,99)>
   <cfset product = "Product #X#">
   <cfset queryAddRow(data)>
   <cfset querySetCell(data, "price", total+0, x)>
   <cfset querySetCell(data, "product", product, x)>
</cfloop>

<cfform name="test">
<cfgrid autowidth="true" name="data" format="html" query="data" width="600">
<cfgridcolumn name="price" header="Price">
<cfgridcolumn name="product" header="Product">
</cfgrid>
</cfform>

<cfset ajaxOnLoad("testgrid")>
</body>
</html>

Picked up from Raymond Camden's blog. I need to somehow add a mouseover event to product column to display product details. (like cost).

Any help on how to implement this event?

 
Ended up doing a cfquery/oracle hacky sack.

Code:
select 
 '<a href="##" onMouseOver="javascript:showWin(''dsp_clientDetails.cfm'',''' || c.cmid || ''')" onMouseOut="javascript:cleanup()">' || c.FIRST_NAME || '</a>' as FIRST_NAME
from ...


Once the cfgrid runs:

<cfgridcolumn name="first_name" header="First Name">

It's able to call showWin() function. In case somebody else runs into the same problem...



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top