[]
Sheets.FloatingObjects.Picture
↳ Picture
• new Picture(name, src, x, y, width, height)
表示一个图片。
| Name | Type | Description |
|---|---|---|
name |
string |
图片的名称。 |
src |
string |
图片的图像源。 |
x |
number |
图片的 x 坐标位置。 |
y |
number |
图片的 y 坐标位置。 |
width |
number |
图片的宽度。 |
height |
number |
图片的高度。 |
• typeName: string
表示用于支持序列化的类型名称字符串。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('floatingObject', 10, 10, 64, 30);
console.log(customFloatingObject.typeName); // "0"
▸ allowMove(value?): any
获取或设置是否禁用移动浮动对象。
example
//此示例禁止移动或调整浮动对象大小。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
是否禁用移动浮动对象的设置。 |
any
如果未设置值,则返回是否禁用移动浮动对象的设置;否则返回浮动对象。
▸ allowResize(value?): any
获取或设置是否禁用调整浮动对象大小。
example
//此示例禁止移动或调整浮动对象大小。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.allowResize(false);
customFloatingObject.allowMove(false);
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
是否禁用调整浮动对象大小的设置。 |
any
如果未设置值,则返回是否禁用调整浮动对象大小的设置;否则返回浮动对象。
▸ alt(value?): any
获取或设置浮动对象的替代文本(用于屏幕阅读器)。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
customFloatingObject.alt("一个按钮");
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
string |
浮动对象的替代文本。 |
any
浮动对象的替代文本。
▸ backColor(value?): any
获取或设置图片的背景颜色。
example
//此示例设置图片的背景颜色。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
| Name | Type | Description |
|---|---|---|
value? |
string |
图片的背景颜色。 |
any
如果未设置值,则返回图片的背景颜色;否则返回图片。
▸ borderColor(value?): any
获取或设置图片的边框颜色。
example
//此示例设置图片的边框颜色。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
| Name | Type | Description |
|---|---|---|
value? |
string |
图片的边框颜色。 |
any
如果未设置值,则返回图片的边框颜色;否则返回图片。
▸ borderRadius(value?): any
获取或设置图片的边框圆角。
example
//此示例使用borderRadius方法。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.backColor("blue");
picture.borderWidth(2);
picture.borderColor("red");
picture.borderStyle("dotted");
picture.borderRadius(5);
| Name | Type | Description |
|---|---|---|
value? |
number |
图片的边框圆角。 |
any
如果未设置值,则返回图片的边框圆角;否则返回图片。
▸ borderStyle(value?): any
获取或设置图片的边框样式。
example
//此示例使用 borderStyle 方法。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("dotted");
picture.borderWidth(2);
picture.borderColor("red");
| Name | Type | Description |
|---|---|---|
value? |
string |
图片的 CSS 边框样式,例如 dotted、dashed、solid 等。 |
any
如果未设置值,则返回图片的边框样式;否则返回图片。
▸ borderWidth(value?): any
获取或设置图片的边框宽度。
example
//此示例使用 borderWidth 方法。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.borderStyle("solid");
picture.borderWidth(2);
picture.borderColor("red");
| Name | Type | Description |
|---|---|---|
value? |
number |
图片的边框宽度。 |
any
如果未设置值,则返回图片的边框宽度;否则返回图片。
▸ cloneContent(): HTMLElement
获取实例当前内容的副本。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30);
customFloatingObject.content(createButton('button 1', '64px', '30px'));
activeSheet.floatingObjects.add(customFloatingObject);
var btn = customFloatingObject.cloneContent();
btn.innerText = 'button 2';
customFloatingObject.content(btn);
function createButton (text, width, height) {
var btn = document.createElement('button');
btn.style.width = width;
btn.style.height = height;
btn.innerText = text;
return btn;
}
HTMLElement
实例当前内容的副本。
▸ content(value?): any
获取或设置自定义浮动对象的内容。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30);
customFloatingObject.content(createButton('button 1', '64px', '30px'));
activeSheet.floatingObjects.add(customFloatingObject);
console.log(customFloatingObject.content()); // 获取当前内容,结果是文本为"button 1"的按钮元素。
customFloatingObject.content(createButton('button 2', '64px', '30px')); // 设置新内容。
function createButton (text, width, height) {
var btn = document.createElement('button');
btn.style.width = width;
btn.style.height = height;
btn.innerText = text;
return btn;
}
| Name | Type | Description |
|---|---|---|
value? |
HTMLElement |
自定义浮动对象的内容。 |
any
如果未设置值,则返回自定义浮动对象的内容;否则返回浮动对象。
▸ dynamicMove(value?): any
获取或设置当隐藏或显示、调整大小或移动行或列时,对象是否移动。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
指示当隐藏或显示、调整大小或移动行或列时,对象是否移动的值。 |
any
如果未设置值,则返回此浮动对象是否动态移动;否则返回浮动对象。
▸ dynamicSize(value?): any
获取或设置当隐藏或显示、调整大小或移动行或列时,对象的大小是否改变。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
指示当隐藏或显示、调整大小或移动行或列时,对象的大小是否改变的值。 |
any
如果未设置值,则返回此浮动对象是否动态改变大小;否则返回浮动对象。
▸ endColumn(value?): any
获取或设置浮动对象位置的结束列索引。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//通过单元格锚点定位浮动对象的右下角。
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象位置的结束列索引。 |
any
如果未设置值,则返回浮动对象位置的结束列索引;否则返回浮动对象。
▸ endColumnOffset(value?): any
获取或设置浮动对象相对于结束列的偏移量。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//通过单元格锚点定位浮动对象的右下角。
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象相对于结束列的偏移量。 |
any
如果未设置值,则返回浮动对象相对于结束列的偏移量;否则返回浮动对象。
FloatingObject.endColumnOffset
▸ endRow(value?): any
获取或设置浮动对象位置的结束行索引。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//通过单元格锚点定位浮动对象的右下角。
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象位置的结束行索引。 |
any
如果未设置值,则返回浮动对象位置的结束行索引;否则返回浮动对象。
▸ endRowOffset(value?): any
获取或设置相对于浮动对象结束行的偏移量。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
//通过单元格锚点定位浮动对象的右下角。
customFloatingObject.endRow(7);
customFloatingObject.endColumn(5);
customFloatingObject.endRowOffset(10);
customFloatingObject.endColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
相对于浮动对象结束行的偏移量。 |
any
如果未设置值,则返回相对于浮动对象结束行的偏移量;否则返回浮动对象。
▸ fixedPosition(value): any
获取或设置浮动对象的位置是否固定。当 fixedPosition 为 true 时,dynamicMove 和 dynamicSize 将被禁用。
example
//此示例将对象的位置设置为固定。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.fixedPosition(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type |
|---|---|
value |
boolean |
any
如果未设置值,则返回浮动对象的位置是否固定;否则返回浮动对象。
▸ getHost(): HTMLElement[]
获取自定义内容的DOM宿主。
HTMLElement[]
▸ getOriginalHeight(): number
获取图片的原始高度。
example
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
alert(picture.getOriginalHeight());
});
number
图片的原始高度。
▸ getOriginalWidth(): number
获取图片的原始宽度。
example
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
var picture = activeSheet.pictures.get("f2");
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center);
//button
$("#button1").click(function () {
alert(picture.getOriginalWidth());
});
number
图片的原始宽度。
▸ height(value?): any
获取或设置浮动对象的高度。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象的高度。 |
any
如果未设置值,则返回浮动对象的高度;否则返回浮动对象。
▸ isLocked(value?): any
获取或设置此浮动对象是否被锁定。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
customFloatingObject.isLocked(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.options.isProtected = true;
| Name | Type | Description |
|---|---|---|
value? |
boolean |
指示此浮动对象是否被锁定的值。 |
any
如果未设置值,则返回此浮动对象是否被锁定;否则返回浮动对象。
▸ isSelected(value?): any
获取或设置此浮动对象是否被选中。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isSelected(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
指示此浮动对象是否被选中的值。 |
any
如果未设置值,则返回此浮动对象是否被选中;否则返回浮动对象。
▸ isVisible(value?): any
获取或设置此浮动对象是否可见。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
customFloatingObject.isVisible(true);
customFloatingObject.dynamicSize(true);
customFloatingObject.dynamicMove(true);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
boolean |
指示此浮动对象是否可见的值。 |
any
如果未设置值,则返回此浮动对象是否可见;否则返回浮动对象。
▸ name(value?): any
获取浮动对象的名称。
example
//此示例使用name方法。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject();
customFloatingObject.name("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
string |
浮动对象的名称。 |
any
如果未设置值,则返回浮动对象的名称;否则返回浮动对象。
▸ pictureStretch(value?): any
获取或设置图片的拉伸方式。
example
//此示例使用pictureStretch方法。
var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100);
picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch);
picture.backColor("blue");
| Name | Type | Description |
|---|---|---|
value? |
ImageLayout |
图片的拉伸方式。 |
any
如果未设置值,则返回图片的拉伸方式;否则返回图片。
▸ refreshContent(): void
刷新浮动对象中的内容。用户应该重写此方法以使其内容与浮动对象保持同步。
example
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('floatingObject', 10, 10, 64, 30);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
// 隐藏浮动对象
customFloatingObject.isVisible(false);
activeSheet.floatingObjects.add(customFloatingObject);
// 显示浮动对象
customFloatingObject.isVisible(true);
customFloatingObject.refreshContent(customFloatingObject.content());
void
▸ src(value?): any
获取或设置图片的源地址。
example
var pic = sheet.pictures.add("Picture 1", "Event.png", 100, 50, 200, 200);
var src = pic.src(); // 获取当前图片源,结果为"Event.png"。
pic.src("tsoutline.png"); // 设置新的图片源。
| Name | Type | Description |
|---|---|---|
value? |
string |
图片的源地址。 |
any
如果未设置值,则返回图片的源地址;否则返回图片。
▸ startColumn(value?): any
获取或设置浮动对象位置的起始列索引。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象位置的起始列索引。 |
any
如果未设置值,则返回浮动对象位置的起始列索引;否则返回浮动对象。
▸ startColumnOffset(value?): any
获取或设置浮动对象相对于起始列的偏移量。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象相对于起始列的偏移量。 |
any
如果未设置值,则返回浮动对象相对于起始列的偏移量;否则返回浮动对象。
FloatingObject.startColumnOffset
▸ startRow(value?): any
获取或设置浮动对象位置的起始行索引。
example
//创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象位置的起始行索引。 |
any
如果未设置值,则返回浮动对象位置的起始行索引;否则返回浮动对象。
▸ startRowOffset(value?): any
获取或设置浮动对象相对于起始行的偏移量。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
//通过单元格锚点定位浮动对象的左上角。
customFloatingObject.startRow(2);
customFloatingObject.startColumn(2);
customFloatingObject.startRowOffset(10);
customFloatingObject.startColumnOffset(10);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象相对于起始行的偏移量。 |
any
如果未设置值,则返回浮动对象相对于起始行的偏移量;否则返回浮动对象。
▸ width(value?): any
获取或设置浮动对象的宽度。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象的宽度。 |
any
如果未设置值,则返回浮动对象的宽度;否则返回浮动对象。
▸ x(value?): any
获取或设置浮动对象的水平位置。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象的水平位置。 |
any
如果未设置值,则返回浮动对象的水平位置;否则返回浮动对象。
▸ y(value?): any
获取或设置浮动对象的垂直位置。
example
//此示例创建一个浮动对象。
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1");
customFloatingObject.x(10);
customFloatingObject.y(10);
customFloatingObject.width(60);
customFloatingObject.height(64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
| Name | Type | Description |
|---|---|---|
value? |
number |
浮动对象的垂直位置。 |
any
如果未设置值,则返回浮动对象的垂直位置;否则返回浮动对象。