Class Index

Classes


Class $.wijmo.wijspread.Spread

Class Summary
Constructor Attributes Constructor Name and Description
 
$.wijmo.wijspread.Spread(name, count, host)
Creates a spreadsheet with the specified name, sheet count, and hosted DOM element.
Field Summary
Field Attributes Field Name and Description
 
Represents the name of the Spread control.
 
Represents the sheet collection.
 
Whether Spread should use the Wijmo theme.
Method Summary
Method Attributes Method Name and Description
 
Adds a custom function.
 
addCustomName(name, formula, baseRow, baseCol)
Adds a custom name.
 
addSheet(index, sheet)
Inserts a sheet at the specific index.
 
allowUndo(value)
Gets or sets whether to allow the user to undo edit operations.
 
Gets or sets whether to allow the end user to resize columns and rows.
 
Gets or sets whether the user can scale the display of the component using the Ctrl key and the mouse wheel.
 
bind(type, data, fn)
Binds an event to Spread.
 
Gets or sets whether to allow the user to drag and drop cell range data to another range.
 
Gets or sets whether to allow the user to drag fill a range of cells.
 
Clears all custom functions.
 
Clears custom names.
 
Clears all sheets in the control.
 
doCommand(value)
Executes a command.
 
fromJSON(spreadData)
Loads the JSON data.
 
Returns the active sheet.
 
Gets the active sheet index of the control.
 
Gets a custom function.
 
Gets custom name information.
 
getSheet(index)
Gets the specified sheet.
 
Gets the number of sheets.
 
Gets the sheet with the specified name.
 
Gets the width of the tab strip for this component expressed as a percentage of the overall horizontal scroll bar width.
 
Updates the control layout information.
 
Gets or sets a property that indicates whether to refresh automatically or manually after changing Spread UI settings.
 
Gets or sets whether the control displays a special tab that allows users to insert new sheets.
 
Gets or sets the style for cell and range references in cell formulas.
 
Removes a custom function.
 
Removes the specified custom name.
 
removeSheet(index)
Removes a specific sheet.
 
Repaints the Spread control.
 
Resumes the calculation service.
 
search(searchCondition)
Searches the text in the cells in the specified sheet for the specified string with the specified criteria.
 
Sets the active sheet index for the control.
 
Sets the number of sheets.
 
setTabStripRatio(tabStripRatio, skipRefreshScrollbar)
Sets the width of the tab strip expressed as a percentage of the overall horizontal scroll bar width.
 
showActiveCell(verticalPosition, horizontalPosition)
Moves the active cell to the specified position.
 
showCell(row, col, verticalPosition, horizontalPosition)
Moves a cell to the specified position.
 
showColumn(col, horizontalPosition)
Moves a column to the specified position.
 
showRow(row, verticalPosition)
Moves a row to the specified position.
 
Suspends the calculation service.
 
tabEditable(value)
Gets or sets whether the user can edit the tab strip.
 
Gets or sets the display policy for the sheet tab strip.
 
Saves to the JSON data.
 
unbind(type, fn)
Removes the binding of an event to Spread.
 
Removes the binding of all events to Spread.
 
Gets the undo manager for the control.
Class Detail
$.wijmo.wijspread.Spread(name, count, host)
Creates a spreadsheet with the specified name, sheet count, and hosted DOM element.
Parameters:
{string} name
The Spread name.
{number} count
The number of sheets.
{Element} host
The host DOM element.
Field Detail
name
Represents the name of the Spread control. Type: string

sheets
Represents the sheet collection. Type: Array

useWijmoTheme
Whether Spread should use the Wijmo theme. Type: boolean
Method Detail
addCustomFunction(fn)
Adds a custom function.
sheet.setValue(0,0,"112");
sheet.setValue(1,0,"10");
sheet.setValue(2,0,"223");
sheet.setValue(3,0,"20");
sheet.setValue(4,0,"334");
sheet.setValue(5,0,"30");
sheet.sortRange(0, 0, 6, 1, true, [
{index:0, ascending:true}
]);
var fn = $.ce.createFunction("myfunc", function() {
return 100;
}, {minArg:0, maxArg:0});
spread.addCustomFunction(fn);
Parameters:
{Function} fn
The function to add.

addCustomName(name, formula, baseRow, baseCol)
Adds a custom name.
Parameters:
{string} name
The custom name.
{string} formula
The formula.
{number} baseRow
The row index.
{number} baseCol
The column index.

addSheet(index, sheet)
Inserts a sheet at the specific index.
spread.addSheet(0,new $.wijmo.wijspread.Sheet("custom"));
Parameters:
{number} index
The specified index.
{$.wijmo.wijspread.Sheet} sheet
The sheet to be added.

{boolean} allowUndo(value)
Gets or sets whether to allow the user to undo edit operations.
spread.allowUndo(true);
var group = new $.wijmo.wijspread.UndoRedo.GroupExtent(3,5);
var action = new $.wijmo.wijspread.UndoRedo.RowGroupUndoAction(sheet,group);
spread.doCommand(action);
Parameters:
{boolean} value
Set to true to allow the user to undo edits.
Returns:
{boolean} true if the user can undo edits; otherwise, false.

allowUserResize(value)
Gets or sets whether to allow the end user to resize columns and rows.
Parameters:
{boolean} value
Whether the user can resize columns and rows by clicking and dragging cells' borders.

allowUserZoom(value)
Gets or sets whether the user can scale the display of the component using the Ctrl key and the mouse wheel.
spread.allowUserZoom = false;
sheet.zoom(3);
Parameters:
{boolean} value
Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key.

bind(type, data, fn)
Binds an event to Spread.
sheet.setActiveCell(5,5);
alert(sheet.getActiveColumnIndex());
alert(sheet.getActiveRowIndex());
spread.bind($.wijmo.wijspread.Events.EnterCell, function (event, data) {
alert(data.col);
alert(data.row);
});
spread.bind($.wijmo.wijspread.Events.LeaveCell, function (event, data) {
alert(data.col);
alert(data.row);
});
Parameters:
{$.wijmo.wijspread.Events} type
The event type.
{object} data
Optional. Specifies additional data to pass along to the function.
{object} fn
Specifies the function to run when the event occurs.

{boolean} canUserDragDrop(value)
Gets or sets whether to allow the user to drag and drop cell range data to another range.
Parameters:
{boolean} value
Set to true to allow the user to drag and drop range data.
Returns:
{boolean} true if the user is allowed to drag and drop range data; otherwise, false.

{boolean} canUserDragFill(value)
Gets or sets whether to allow the user to drag fill a range of cells.
Parameters:
{boolean} value
Set to true to allow the user to drag fill a range.
Returns:
{boolean} true if the user is allowed to drag fill; otherwise, false.

clearCustomFunctions()
Clears all custom functions.

clearCustomNames()
Clears custom names.

clearSheets()
Clears all sheets in the control.

doCommand(value)
Executes a command.
spread.allowUndo(true);
var group = new $.wijmo.wijspread.UndoRedo.GroupExtent(3,5);
var action = new $.wijmo.wijspread.UndoRedo.RowGroupUndoAction(sheet,group);
spread.doCommand(action);
Parameters:
{ActionBase} value
Action to be performed.

fromJSON(spreadData)
Loads the JSON data.
Parameters:
{object} spreadData
The spreadsheet data from deserialization.

{$.wijmo.wijspread.Sheet} getActiveSheet()
Returns the active sheet.
Returns:
{$.wijmo.wijspread.Sheet} The sheet instance.

{number} getActiveSheetIndex()
Gets the active sheet index of the control.
Returns:
{number} The active sheet index.

{Function} getCustomFunction(name)
Gets a custom function.
Parameters:
{string} name
The custom function name.
Returns:
{Function} The custom function.

{$.wijmo.wijspread.NameInfo} getCustomName(name)
Gets custom name information.
Parameters:
{string} name
The custom name.
Returns:
{$.wijmo.wijspread.NameInfo} The information for the specified custom name.

{$.wijmo.wijspread.Sheet} getSheet(index)
Gets the specified sheet.
Parameters:
{number} index
The index of the sheet to return.
Returns:
{$.wijmo.wijspread.Sheet} The sheet.

{number} getSheetCount()
Gets the number of sheets.
Returns:
{number} The number of sheets.

{$.wijmo.wijspread.Sheet} getSheetFromName(name)
Gets the sheet with the specified name.
Parameters:
{string} name
The sheet name.
Returns:
{$.wijmo.wijspread.Sheet} The sheet with the specified name.

{number} getTabStripRatio()
Gets the width of the tab strip for this component expressed as a percentage of the overall horizontal scroll bar width.
Returns:
{number} The width of the tab strip for this component expressed as a percentage of the overall horizontal scroll bar width.

invalidateLayout()
Updates the control layout information.

{object} isPaintSuspended(value)
Gets or sets a property that indicates whether to refresh automatically or manually after changing Spread UI settings.
Parameters:
{boolean} value
Whether to refresh the UI automatically.
Returns:
{object} If this function is called without a parameter, it returns a boolean that indicates the current refresh option; otherwise, it returns the current Spread object.

newTabVisible(value)
Gets or sets whether the control displays a special tab that allows users to insert new sheets.
spread.tabStripVisible =true;
spread.tabEditable= true;
spread.newTabVisible = true;
spread.setTabStripRatio(1,true);
Parameters:
{boolean} value
Whether the control displays the special tab to allow users to insert new sheets.

{$.wijmo.wijspread.ReferenceStyle} referenceStyle(value)
Gets or sets the style for cell and range references in cell formulas.
Parameters:
{$.wijmo.wijspread.ReferenceStyle} value
The reference style.
Returns:
{$.wijmo.wijspread.ReferenceStyle} The reference style.

removeCustomFunction(name)
Removes a custom function.
Parameters:
{string} name
The custom function name.

removeCustomName(name)
Removes the specified custom name.
Parameters:
{string} name
The custom name.

removeSheet(index)
Removes a specific sheet.
spread.setSheetCount(5);
spread.removeSheet(0);
Parameters:
{number} index
The index of the sheet to remove.

repaint()
Repaints the Spread control.

resumeEvent()
Resumes the calculation service.

{SearchResult} search(searchCondition)
Searches the text in the cells in the specified sheet for the specified string with the specified criteria.
var searchCondition = new $.wijmo.wijspread.SearchCondition();
searchCondition.searchString = "testSearch";
searchCondition.startSheetIndex = spread.getActiveSheetIndex();
searchCondition.endSheetIndex = spread.getActiveSheetIndex();
searchCondition.searchOrder = $.wijmo.wijspread.SearchOrder.NOrder;
searchCondition.searchTarget = $.wijmo.wijspread.SearchFoundFlags.CellText;
searchCondition.searchFlags = $.wijmo.wijspread.SearchFlags.Ignorecode| $.wijmo.wijspread.SearchFlags.UseWildCards;
var searchresult= spread.search(searchCondition);
var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" +
searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]";
alert(str);
Parameters:
{SearchCondition} searchCondition
The search conditions.
Returns:
{SearchResult} The search result.

setActiveSheetIndex(value)
Sets the active sheet index for the control.
Parameters:
{number} value
The active sheet index.

setSheetCount(count)
Sets the number of sheets.
spread.setSheetCount(5);
Parameters:
{number} count
The number of sheets.

setTabStripRatio(tabStripRatio, skipRefreshScrollbar)
Sets the width of the tab strip expressed as a percentage of the overall horizontal scroll bar width.
spread.tabStripVisible =true;
spread.tabEditable= true;
spread.newTabVisible = true;
spread.setTabStripRatio(1,true);
Parameters:
{number} tabStripRatio
The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width.
{boolean} skipRefreshScrollbar
Whether to skip refreshing the scroll bar. Set to true to not refresh the scroll bar.

showActiveCell(verticalPosition, horizontalPosition)
Moves the active cell to the specified position.
Parameters:
{$.wijmo.wijspread.VerticalPosition} verticalPosition
The vertical position for the cell.
{$.wijmo.wijspread.HorizontalPosition} horizontalPosition
The horizontal position for the cell.

showCell(row, col, verticalPosition, horizontalPosition)
Moves a cell to the specified position.
Parameters:
{number} row
The row index.
{number} col
The column index.
{$.wijmo.wijspread.VerticalPosition} verticalPosition
The vertical position for the cell.
{$.wijmo.wijspread.HorizontalPosition} horizontalPosition
The horizontal position for the cell.

showColumn(col, horizontalPosition)
Moves a column to the specified position.
Parameters:
{number} col
The column index.
{$.wijmo.wijspread.HorizontalPosition} horizontalPosition
The horizontal position for the column.

showRow(row, verticalPosition)
Moves a row to the specified position.
Parameters:
{number} row
The row index.
{$.wijmo.wijspread.VerticalPosition} verticalPosition
The vertical position for the row.

suspendEvent()
Suspends the calculation service.

tabEditable(value)
Gets or sets whether the user can edit the tab strip.
spread.tabStripVisible =true;
spread.tabEditable= true;
spread.newTabVisible = true;
spread.setTabStripRatio(1,true);
Parameters:
{boolean} value
Whether the user can edit the tab strip name.

tabStripVisible(value)
Gets or sets the display policy for the sheet tab strip.
spread.tabStripVisible =true;
spread.tabEditable= true;
spread.newTabVisible = true;
spread.setTabStripRatio(1,true);
Parameters:
{boolean} value
Whether to show the tab strip.

{object} toJSON()
Saves to the JSON data.
Returns:
{object} The spreadsheet data.

unbind(type, fn)
Removes the binding of an event to Spread.
Parameters:
{$.wijmo.wijspread.Events} type
The event type.
{object} fn
Specifies the function to run when the event occurs.

unbindAll()
Removes the binding of all events to Spread.

undoManager()
Gets the undo manager for the control.

©2013. ComponentOne, a division of GrapeCity. All Rights Reserved.