您好,下拉框中有一个 可见 属性,能够控制什么时候显示下拉框按钮:
可以参考该链接:https://demo.grapecity.com.cn/sp ... s.Style#cellbuttons
示例代码如下:
var verticalStyle = new GC.Spread.Sheets.Style();
verticalStyle.cellButtons = [
{
imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
command: "openList",
useButtonStyle: true,
visibility: GC.Spread.Sheets.ButtonVisibility.onSelected,
}
];
verticalStyle.dropDowns = [
{
type: GC.Spread.Sheets.DropDownType.list,
option: {
multiSelect: false,
items: [
{
text: 'item1',
value: 'item1'
},
{
text: 'item2',
value: 'item2'
},
{
text: 'item3',
value: 'item3'
},
{
text: 'item4',
value: 'item4'
}
],
}
}
];
sheet.setText(2, 1, "Vertical text list");
sheet.setStyle(3, 1, verticalStyle); |