cfgrid 和 cfajaximport mouseover

发布于 2024-07-27 00:14:45 字数 1279 浏览 3 评论 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>

摘自雷蒙德·卡姆登的博客。 我需要以某种方式向产品列添加鼠标悬停事件以显示产品详细信息。 (如成本)。

对如何实施此活动有任何帮助吗?

I have the following:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

身边 2024-08-03 00:14:45

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

<cfset product = 

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

否则,您将需要使用 extJ。

I ended up creating html inside the query cell.

<cfset product = 

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

Otherwise, you will need to play with extJs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文