找回密码
 立即注册

QQ登录

只需一步,快速开始

tingche

银牌会员

17

主题

76

帖子

3877

积分

银牌会员

积分
3877

活字格认证

tingche
银牌会员   /  发表于:2013-6-24 15:49  /   查看:4686  /  回复:1
js如何获取spread dropdownlist项的value

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-6-24 17:25:00
沙发
回复 1楼tingche的帖子

tingche 你好,

在前台取到的前提是设置 ComboBoxCellType 的 ShowButton 为 true。
请通过以下代码测试:
JS:

  1.     <script language="javascript" type="text/javascript">
  2. // <![CDATA[

  3.         function Button1_onclick() {
  4.             var cell = this.document.getElementById("FpSpread1_1,0");

  5.             alert(cell.innerHTML);
  6.         }

  7. // ]]>
  8.     </script>
复制代码


C#

  1. protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }

  7.             string[] cbstr;
  8.             string[] strval;
  9.             cbstr = new String[] { "One", "Two", "Three" };
  10.             strval = new String[] { "1", "2", "3" };
  11.             FarPoint.Web.Spread.ComboBoxCellType cb = new FarPoint.Web.Spread.ComboBoxCellType();
  12.             cb.Items = cbstr;
  13.             cb.ShowButton = true;
  14.             FpSpread1.ActiveSheetView.Columns[0].CellType = cb;
  15.         }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部