找回密码
 立即注册

QQ登录

只需一步,快速开始

woxptc

注册会员

2

主题

6

帖子

12

积分

注册会员

积分
12

活字格认证

最新发帖
woxptc
注册会员   /  发表于:2012-4-12 11:26  /   查看:5094  /  回复:3
Cell宽度固定, Cell里面内容显示不下,不进行换行,以“…”形式进行省略表示,当鼠标移到相对应的Cell,则弹出小框显示所有内容。

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-4-12 12:09:00
沙发

回复 1# woxptc 的帖子

woxptc 你好,可以通过以下方法实现:
前台代码:

  1.     <script type="text/javascript">
  2.         window.onload = function myfunction() {
  3.             var spreadTable = this.document.getElementById("FpSpread1_viewport");
  4.             spreadTable.onmousemove = test;
  5.         }
  6.         function test() {
  7.             var col = event.srcElement.cellIndex;
  8.             var row = event.srcElement.parentElement.rowIndex;
  9.             if ((!isNaN(col)) &amp;&amp; (!isNaN(row)) &amp;&amp; (0 <= row) &amp;&amp; (row < FpSpread1.GetRowCount())) {
  10.                 var cell = FpSpread1.GetCellByRowCol(row, col);
  11.                 alert(cell.innerText);
  12.             }
  13.         }
  14.     </script>
复制代码
后台代码:
  1. FarPoint.Web.Spread.TextCellType textcell = new FarPoint.Web.Spread.TextCellType();
  2.             textcell.AllowWrap = false;
  3.             textcell.ShowEllipsis = true;
  4.             FpSpread1.Sheets[0].Cells[0, 0].CellType = textcell;
  5.             FpSpread1.Sheets[0].Cells[0, 0].Text = "ddddddddddddddddddddddddddddddddddd";
复制代码
回复 使用道具 举报
woxptc
注册会员   /  发表于:2012-4-12 16:36:00
板凳
感谢版主的回答, 问题基本解决.
我问题描述的不大清楚, 弹出小框实际就是Note属性达到的效果.
顺带再问下, Note属性的效果可以设置显示的时间么?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-4-13 17:28:00
地板

回复 3# woxptc 的帖子

woxptc 你好,
不好意思,Note 属性目前没有办法设置显示时间长度。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部