0

我有以下内容:

<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>

摘自 Raymond Camden 的博客。我需要以某种方式将鼠标悬停事件添加到产品列以显示产品详细信息。(如成本)。

有关如何实施此事件的任何帮助?

4

1 回答 1

0

我最终在查询单元格中创建了 html。

<cfset product = 

'<a href="##" onMouseOver="javascript:showWin(''dsp_productDetails.cfm?pid='' & Product#x# & '') onMouseOut="javascript:cleanup()">' & Product#x# & '</a>'>

否则,您将需要使用 extJs。

于 2009-08-26T13:49:49.343 回答