SpreadJS 13
GC.Spread.Sheets Namespace / Workbook type / Workbook Constructor
The host DOM element.
The initialization options.
The number of sheets.
The tab strip font.
Whether to allow the user to drag merge cells.
Whether to allow the user to drag and drop range data.
Whether to allow the user to drag fill a range.
Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key.
Whether to allow the user to resize columns and rows.
Whether to allow the user to undo edits.
Whether the user can reorder the sheets in the Spread component.
Whether to allow the user to open the built-in context menu.
Whether to allow the user to can use deselect in selection.
The default fill type.
Whether to display the drag fill dialog.
Whether to display the horizontal scroll bar.
Whether to display the vertical scroll bar.
Whether the displayed scroll bars are based on the entire number of columns and rows in the sheet.
Whether the scroll bar aligns with the last row and column of the active sheet.
Whether to display the sheet tab strip.
The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width.
Whether to allow the user to edit the sheet tab strip.
Whether the spreadsheet displays the special tab to let users insert new sheets.
Whether to display the sheet tab navigation.
Whether to display an indicator when copying or cutting the selected item.
The border color for the indicator displayed when the user cuts or copies the selection.
A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on.
The background image of the Spread component.
The background image layout for the Spread component.
A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on.
How to display the resize tip.
-Whether to display the drag-drop tip.
Whether to display the drag-fill tip.
How to display the scroll tip.
Whether the scroll bar ignores hidden rows or columns.
Whether to highlight invalid data.
Whether to use touch layout to present the Spread component.
Whether to display the selection highlighting when the Spread component does not have focus.
The drawing policy when the row or column is resized to zero.
Whether the user can edit formulas in a cell in the spreadsheet.
Whether to enable the formula text box in the spreadsheet.
Whether content will be formatted to fit in cells or in cells and headers.
the style for cell and range references in cell formulas on this sheet.
Whether to calculate formulas only when they are demanded.
Whether the user can copy style from Spread Sheets then paste to Excel, or copy style from Excel then paste to Spread Sheets.
Whether extend paste range if the paste range is not enough for pasting.
Which headers are included when data is copied to or pasted.
Whether to enable the precision scrolling by pixel.
Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta multiply scrollPixel. For example, the scrolling delta is 3, and the scrollPixel is 5, the final scrolling pixels are 15.
Whether to enable auto creating hyperlink in the spreadsheet.
Specifies the way to resize column.
Specifies the way to resize row.
The list for user to customize drag fill, prioritize matching this list in each fill. Each array item is type of string array.
The scrollbar appearance, contains skin and mobile two enums. Default is skin.
In This Topic
    Workbook Constructor
    In This Topic
    Represents a spreadsheet with the specified hosted DOM element and options setting.
    Syntax
    var instance = new GC.Spread.Sheets.Workbook(host,
                                                options,
                                                options.sheetCount,
                                                options.font,
                                                options.allowUserDragMerge,
                                                options.allowUserDragDrop,
                                                options.allowUserDragFill,
                                                options.allowUserZoom,
                                                options.allowUserResize,
                                                options.allowUndo,
                                                options.allowSheetReorder,
                                                options.allowContextMenu,
                                                options.allowUserDeselect,
                                                options.defaultDragFillType,
                                                options.showDragFillSmartTag,
                                                options.showHorizontalScrollbar,
                                                options.showVerticalScrollbar,
                                                options.scrollbarShowMax,
                                                options.scrollbarMaxAlign,
                                                options.tabStripVisible,
                                                options.tabStripRatio,
                                                options.tabEditable,
                                                options.newTabVisible,
                                                options.tabNavigationVisible,
                                                options.cutCopyIndicatorVisible,
                                                options.cutCopyIndicatorBorderColor,
                                                options.backColor,
                                                options.backgroundImage,
                                                options.backgroundImageLayout,
                                                options.grayAreaBackColor,
                                                options.showResizeTip,
                                                options.showDragDropTip,
                                                options.showDragFillTip,
                                                options.showScrollTip,
                                                options.scrollIgnoreHidden,
                                                options.highlightInvalidData,
                                                options.useTouchLayout,
                                                options.hideSelection,
                                                options.resizeZeroIndicator,
                                                options.allowUserEditFormula,
                                                options.enableFormulaTextbox,
                                                options.autoFitType,
                                                options.referenceStyle,
                                                options.calcOnDemand,
                                                options.allowCopyPasteExcelStyle,
                                                options.allowExtendPasteRange,
                                                options.copyPasteHeaderOptions,
                                                options.scrollByPixel,
                                                options.scrollPixel,
                                                options.allowAutoCreateHyperlink,
                                                options.columnResizeMode,
                                                options.rowResizeMode,
                                                options.customList,
                                                options.scrollbarAppearance);
    function Workbook( 
       host : HTMLElement,
       (optional) options : Object,
       (optional) options.sheetCount : number,
       (optional) options.font : string,
       (optional) options.allowUserDragMerge : boolean,
       (optional) options.allowUserDragDrop : boolean,
       (optional) options.allowUserDragFill : boolean,
       (optional) options.allowUserZoom : boolean,
       (optional) options.allowUserResize : boolean,
       (optional) options.allowUndo : boolean,
       (optional) options.allowSheetReorder : boolean,
       (optional) options.allowContextMenu : boolean,
       (optional) options.allowUserDeselect : boolean,
       (optional) options.defaultDragFillType : AutoFillType,
       (optional) options.showDragFillSmartTag : boolean,
       (optional) options.showHorizontalScrollbar : boolean,
       (optional) options.showVerticalScrollbar : boolean,
       (optional) options.scrollbarShowMax : boolean,
       (optional) options.scrollbarMaxAlign : boolean,
       (optional) options.tabStripVisible : boolean,
       (optional) options.tabStripRatio : number,
       (optional) options.tabEditable : boolean,
       (optional) options.newTabVisible : boolean,
       (optional) options.tabNavigationVisible : boolean,
       (optional) options.cutCopyIndicatorVisible : boolean,
       (optional) options.cutCopyIndicatorBorderColor : string,
       (optional) options.backColor : string,
       (optional) options.backgroundImage : string,
       (optional) options.backgroundImageLayout : ImageLayout,
       (optional) options.grayAreaBackColor : string,
       (optional) options.showResizeTip : ShowResizeTip,
       (optional) options.showDragDropTip : boolean,
       (optional) options.showDragFillTip : boolean,
       (optional) options.showScrollTip : ShowScrollTip,
       (optional) options.scrollIgnoreHidden : boolean,
       (optional) options.highlightInvalidData : boolean,
       (optional) options.useTouchLayout : boolean,
       (optional) options.hideSelection : boolean,
       (optional) options.resizeZeroIndicator : ResizeZeroIndicator,
       (optional) options.allowUserEditFormula : boolean,
       (optional) options.enableFormulaTextbox : boolean,
       (optional) options.autoFitType : AutoFitType,
       (optional) options.referenceStyle : ReferenceStyle,
       (optional) options.calcOnDemand : boolean,
       (optional) options.allowCopyPasteExcelStyle : boolean,
       (optional) options.allowExtendPasteRange : boolean,
       (optional) options.copyPasteHeaderOptions : CopyPasteHeaderOptions,
       (optional) options.scrollByPixel : boolean,
       (optional) options.scrollPixel : number,
       (optional) options.allowAutoCreateHyperlink : boolean,
       (optional) options.columnResizeMode : ResizeMode,
       (optional) options.rowResizeMode : ResizeMode,
       (optional) options.customList : Array,
       (optional) options.scrollbarAppearance : ScrollbarAppearance
    ) : Workbook;

    Parameters

    host
    The host DOM element.
    options
    The initialization options.
    options.sheetCount
    The number of sheets.
    options.font
    The tab strip font.
    options.allowUserDragMerge
    Whether to allow the user to drag merge cells.
    options.allowUserDragDrop
    Whether to allow the user to drag and drop range data.
    options.allowUserDragFill
    Whether to allow the user to drag fill a range.
    options.allowUserZoom
    Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key.
    options.allowUserResize
    Whether to allow the user to resize columns and rows.
    options.allowUndo
    Whether to allow the user to undo edits.
    options.allowSheetReorder
    Whether the user can reorder the sheets in the Spread component.
    options.allowContextMenu
    Whether to allow the user to open the built-in context menu.
    options.allowUserDeselect
    Whether to allow the user to can use deselect in selection.
    options.defaultDragFillType
    The default fill type.
    options.showDragFillSmartTag
    Whether to display the drag fill dialog.
    options.showHorizontalScrollbar
    Whether to display the horizontal scroll bar.
    options.showVerticalScrollbar
    Whether to display the vertical scroll bar.
    options.scrollbarShowMax
    Whether the displayed scroll bars are based on the entire number of columns and rows in the sheet.
    options.scrollbarMaxAlign
    Whether the scroll bar aligns with the last row and column of the active sheet.
    options.tabStripVisible
    Whether to display the sheet tab strip.
    options.tabStripRatio
    The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width.
    options.tabEditable
    Whether to allow the user to edit the sheet tab strip.
    options.newTabVisible
    Whether the spreadsheet displays the special tab to let users insert new sheets.
    options.tabNavigationVisible
    Whether to display the sheet tab navigation.
    options.cutCopyIndicatorVisible
    Whether to display an indicator when copying or cutting the selected item.
    options.cutCopyIndicatorBorderColor
    The border color for the indicator displayed when the user cuts or copies the selection.
    options.backColor
    A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on.
    options.backgroundImage
    The background image of the Spread component.
    options.backgroundImageLayout
    The background image layout for the Spread component.
    options.grayAreaBackColor
    A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on.
    options.showResizeTip
    How to display the resize tip.
    options.showDragDropTip
    -Whether to display the drag-drop tip.
    options.showDragFillTip
    Whether to display the drag-fill tip.
    options.showScrollTip
    How to display the scroll tip.
    options.scrollIgnoreHidden
    Whether the scroll bar ignores hidden rows or columns.
    options.highlightInvalidData
    Whether to highlight invalid data.
    options.useTouchLayout
    Whether to use touch layout to present the Spread component.
    options.hideSelection
    Whether to display the selection highlighting when the Spread component does not have focus.
    options.resizeZeroIndicator
    The drawing policy when the row or column is resized to zero.
    options.allowUserEditFormula
    Whether the user can edit formulas in a cell in the spreadsheet.
    options.enableFormulaTextbox
    Whether to enable the formula text box in the spreadsheet.
    options.autoFitType
    Whether content will be formatted to fit in cells or in cells and headers.
    options.referenceStyle
    the style for cell and range references in cell formulas on this sheet.
    options.calcOnDemand
    Whether to calculate formulas only when they are demanded.
    options.allowCopyPasteExcelStyle
    Whether the user can copy style from Spread Sheets then paste to Excel, or copy style from Excel then paste to Spread Sheets.
    options.allowExtendPasteRange
    Whether extend paste range if the paste range is not enough for pasting.
    options.copyPasteHeaderOptions
    Which headers are included when data is copied to or pasted.
    options.scrollByPixel
    Whether to enable the precision scrolling by pixel.
    options.scrollPixel
    Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta multiply scrollPixel. For example, the scrolling delta is 3, and the scrollPixel is 5, the final scrolling pixels are 15.
    options.allowAutoCreateHyperlink
    Whether to enable auto creating hyperlink in the spreadsheet.
    options.columnResizeMode
    Specifies the way to resize column.
    options.rowResizeMode
    Specifies the way to resize row.
    options.customList
    The list for user to customize drag fill, prioritize matching this list in each fill. Each array item is type of string array.
    options.scrollbarAppearance
    The scrollbar appearance, contains skin and mobile two enums. Default is skin.
    Example
    The following examples set options for the workbook.
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0],{sheetCount:3, font:"12pt Arial"});
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0],{sheetcount:3, newTabVisible:false});
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0], { sheetCount: 3, tabEditable: false });
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0],{sheetCount:3, tabStripVisible:false});
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0],{sheetCount:3, allowUserResize:false});
    var spread = new GC.Spread.Sheets.Workbook($("#ss")[0], { sheetCount: 3, allowUserZoom: false});
    Remarks

    This table lists the Workbook options.

    Name Type Description
    sheetCount number The number of sheets, optional.
    font string The tab strip font, optional.
    allowUserDragDrop boolean Specifies whether to allow the user to drag and drop range data, optional.
    allowUserDragFill boolean Specifies whether to allow the user to drag fill a range, optional.
    allowUserZoom boolean Specifies whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key, optional.
    allowUserResize boolean Specifies whether to allow the user to resize columns and rows, optional.
    allowUndo boolean Specifies whether to allow the user to undo edits, optional.
    allowSheetReorder boolean Specifies whether the user can reorder the sheets in the Spread component, optional.
    allowCopyPasteExcelStyle boolean Specifies whether the user can copy styles from SpreadJS and then paste to Excel, or copy styles from Excel and then paste to SpreadJS, optional.
    allowExtendPasteRange boolean Specifies whether to extend the paste range if the paste range is not enough for pasting, optional.
    copyPasteHeaderOptions GC.Spread.Sheets.CopyPasteHeaderOptions Specifies which headers are included when data is copied to or pasted, optional.
    defaultDragFillType GC.Spread.Sheets.Fill.AutoFillType The default fill type, optional.
    showDragFillSmartTag boolean Specifies whether to display the drag fill dialog, optional.
    showHorizontalScrollbar boolean Specifies whether to display the horizontal scroll bar, optional.
    showVerticalScrollbar boolean Specifies whether to display the vertical scroll bar, optional.
    scrollbarShowMax boolean Specifies whether the displayed scroll bars are based on the entire number of columns and rows in the sheet, optional.
    scrollbarMaxAlign boolean Specifies whether the scroll bar aligns with the last row and column of the active sheet, optional.
    tabStripVisible boolean Specifies whether to display the sheet tab strip, optional.
    tabStripRatio number The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width, optional.
    tabEditable boolean Specifies whether to allow the user to edit the sheet tab strip, optional.
    newTabVisible boolean Specifies whether the spreadsheet displays the special tab to let users insert new sheets, optional.
    tabNavigationVisible boolean Specifies whether to display the sheet tab navigation, optional.
    cutCopyIndicatorVisible boolean Specifies whether to display an indicator when copying or cutting the selected item, optional.
    cutCopyIndicatorBorderColor string The border color for the indicator displayed when the user cuts or copies the selection, optional.
    backColor string A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on, optional.
    backgroundImage string The background image of the Spread component, optional.
    backgroundImageLayout GC.Spread.Sheets.ImageLayout The background image layout for the Spread component, optional.
    grayAreaBackColor string A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on, optional.
    showResizeTip GC.Spread.Sheets.ShowResizeTip Specifies how to display the resize tip, optional.
    showDragDropTip boolean Specifies whether to display the drag-drop tip, optional.
    showDragFillTip boolean Specifies whether to display the drag-fill tip, optional.
    showScrollTip GC.Spread.Sheets.ShowScrollTip Specifies how to display the scroll tip, optional.
    scrollIgnoreHidden boolean Specifies whether the scroll bar ignores hidden rows or columns, optional.
    highlightInvalidData boolean Specifies whether to highlight invalid data, optional.
    useTouchLayout boolean Specifies whether to use touch layout to present the Spread component, optional.
    hideSelection boolean Specifies whether to display the selection highlighting when the Spread component does not have focus, optional.
    resizeZeroIndicator GC.Spread.Sheets.ResizeZeroIndicator The drawing policy when the row or column is resized to zero, optional.
    allowUserEditFormula boolean Specifies whether the user can edit formulas in a cell in the spreadsheet, optional.
    enableFormulaTextbox boolean Specifies whether to enable the formula text box in the spreadsheet, optional.
    autoFitType GC.Spread.Sheets.AutoFitType Specifies whether content will be formatted to fit in cells or in cells and headers, optional.
    referenceStyle GC.Spread.Sheets.ReferenceStyle The style for cell and range references in cell formulas on this sheet, optional.
    See Also

    Reference

    Workbook type