找回密码
 立即注册

QQ登录

只需一步,快速开始

hanyu3120552

注册会员

9

主题

24

帖子

193

积分

注册会员

积分
193

活字格认证

hanyu3120552
注册会员   /  发表于:2016-8-8 15:30  /   查看:3589  /  回复:3
下拉列表conboxcelltype,设置后选择了下拉中的一个,JS中如果获取我选择的这一项的Text和Value,找了文档,没有找到相应的方法,getText和getValue都是获取了Text的值,我现在想获得Value怎么写?

3 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-8-8 15:56:06
沙发
您好,通过设置EditorValueType 为 Value

  1. var cellType2 = new GcSpread.Sheets.ComboBoxCellType();
  2. cellType2.items([{text:"A",value:0},{text:"B",value:1},{text:"C",value:22}]);
  3. cellType2.editorValueType(GcSpread.Sheets.EditorValueType.Value);
  4. sheet.getCell(2, 2).cellType(cellType2);
  5. sheet.setValue(2,2,22)
复制代码
回复 使用道具 举报
hanyu3120552
注册会员   /  发表于:2016-8-8 16:43:59
板凳
dexteryao 发表于 2016-8-8 15:56
您好,通过设置EditorValueType 为 Value

editorValueType这个我之前绑定的是Text,哈哈,解决了
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-8-8 16:44:49
地板
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部