2009-07-16 88 views
0

我有以下幾點:CFGRID和cfajaximport鼠標懸停

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

雷蒙德 - 卡姆登的博客回升。我需要以某種方式將一個鼠標懸停事件添加到產品列以顯示產品詳細信息。 (如成本)。

有關如何實施此事件的任何幫助?

回答

0

我結束了在查詢單元格內創建html。

<cfset product = 

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

否則,您將需要使用extJs。