背景SpreadJS 现在支持 TextBox Shapes,可以在工作表的任何位置添加框,其中包含文本。
还可以利用 resizeToFitText 选项自动调整文本框的大小以适应用户的输入。

设计器支持
APIGC.Spread.Sheets.Shapes.Shape.prototype.isTextBox
- ///* function isTextBox(value?: boolean): any
- /**
- * Gets or sets the shape is text box.
- * @param {boolean} value The value indicating whether the shape is a text box.
- * @returns {boolean | void} If no value is set, return whether shape is a text box.
- * @example
- * var rectangle = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 60, 200, 160);
- * rectangle.isTextBox(true);
- */
复制代码
GC.Spread.Sheets.Shapes.IShapeTextFrame
- ///* field textFrame: GC.Spread.Sheets.Shapes.IShapeTextFrame
- /**
- * Indicates the text frame options.
- * @property {GC.Spread.Sheets.VerticalAlign | string} [vAlign] - The text vertical alignment, it is VerticalAlign enum or formula(starts with =).
- * @property {GC.Spread.Sheets.HorizontalAlign | string} [hAlign] - The text horizontal alignment, it is HorizontalAlign enum or formula(starts with =).
- * @property {boolean} [resizeToFitText] - Resize the shape to fit text size.
- * @type {Object}
- * @example
- * // This sample sets the resizeToFitText for the shape.
- * var rectangle = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 60, 200, 160);
- * var oldStyle = rectangle.style();
- * oldStyle.textFrame.resizeToFitText= true;
- * rectangle.style(oldStyle);
- */
复制代码
限制
|
|