找回密码
 立即注册

QQ登录

只需一步,快速开始

zgpinguo

注册会员

7

主题

22

帖子

115

积分

注册会员

积分
115
zgpinguo
注册会员   /  发表于:2016-11-8 19:33  /   查看:3087  /  回复:3
我如果通过代码,设置下拉列表选中某个值

3 个回复

倒序浏览
qsban
中级会员   /  发表于:2016-11-8 19:55:57
沙发
var combo = new spreadNS.ComboBoxCellType();
combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]);
combo.editorValueType(spreadNS.EditorValueType.Text);
sheet.getCell(3, 2, spreadNS.SheetArea.viewport).cellType(combo).value("Grape");
sheet.setValue(3, 1, "ComboBoxCellType");

查看http://demo.gcpowertools.com.cn/ ... mples/basicCellType

评分

参与人数 1金币 +500 收起 理由
dexteryao + 500 完全正确

查看全部评分

回复 使用道具 举报
zgpinguo
注册会员   /  发表于:2016-11-8 21:34:55
板凳
qsban 发表于 2016-11-8 19:55
var combo = new spreadNS.ComboBoxCellType();
combo.items([{ text: "Oranges", value: "11k" }, { tex ...

我的editorValueType是Value,不是text,该怎么弄
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-11-9 08:55:43
地板
是value 的话 就 setValue时候设置value就好了

sheet.setValue(3, 1, "11k");
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部