SpreadJS Documentation
GC.Spread.Sheets Namespace / Workbook type / search Method
The search conditions.
In This Topic
    search Method
    In This Topic
    Searches the text in the cells in the specified sheet for the specified string with the specified criteria.
    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.customList);
    var value; // Type: SearchResult
    value = instance.search(searchCondition);
    function search( 
       searchCondition : SearchCondition
    ) : SearchResult;

    Parameters

    searchCondition
    The search conditions.

    Return Value

    The search result.
    Example
    This example searches the active sheet using the specified search condition.
    activeSheet.getCell(2,3).value("testSearch");
    var searchCondition = new GC.Spread.Sheets.Search.SearchCondition();
    searchCondition.searchString = "testSearch";
    searchCondition.startSheetIndex = spread.getActiveSheetIndex();
    searchCondition.endSheetIndex = spread.getActiveSheetIndex();
    
    searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder;
    searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText;
    searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.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);
    See Also

    Reference

    Workbook type