时间选择器是一个样式,不支持数据绑定,如需添加时间选择器,请使用以下代码
- var showTimeStyle = new GC.Spread.Sheets.Style();
- showTimeStyle.cellButtons = [
- {
- imageType: GC.Spread.Sheets.ButtonImageType.dropdown,
- command: "openDateTimePicker",
- useButtonStyle: true,
- }
- ];
- showTimeStyle.dropDowns = [
- {
- type: GC.Spread.Sheets.DropDownType.dateTimePicker,
- option: {
- showTime: true
- }
- }
- ];
- sheet.setStyle(-1, 1, showTimeStyle);
复制代码
第二个需求可以通过setValue给已经绑定好的单元格赋值,会自动通过到数据源中。
|