setStyle 和 setCellType 的用法有什么区别用setStyle 的时候怎么设置展示text
setStyle :
var verticalStyle = new GC.Spread.Sheets.Style();
let sheet = this.spread.sheets[0];
verticalStyle.cellButtons = [
{
imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
command: "openList",
useButtonStyle: true,
},
];
verticalStyle.dropDowns = [
{
type: GC.Spread.Sheets.DropDownType.list,
option: {
multiSelect: false,
items: [
{
text: "itemqq",
value: "item1",
},
{
text: "item2e",
value: "item2",
},
{
text: "item3ewq",
value: "item3",
},
{
text: "item4ew",
value: "item4",
},
],
},
},
];
sheet.setText(2, 1, "Vertical text list");
sheet.setStyle(3, 1, verticalStyle);
setCellType :
var combo = new GC.Spread.Sheets.CellTypes.ComboBox();
combo.items([
{ text: "Oranges", value: "11k" },
{ text: "Apples", value: "15k" },
{ text: "Grape", value: "100k" },
]);
combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
sheet.setCellType(3, 2, combo, GC.Spread.Sheets.SheetArea.viewport);
还有的就是这个事件监听两种都能监听到吗
sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
var r = args.row;
var c = args.col;
//判断如果单元格内有cellButtons
if (sheet.getCell(r, c).cellButtons()) {
args.cancel = true;
}
});
|
|