Search function not working as expected

Posted by: zhoubing.yang on 23 March 2022, 1:39 pm EST

    • Post Options:
    • Link

    Posted 23 March 2022, 1:39 pm EST

    We are trying to support locate languages search but was not able to when search string is encoded with encodeURIComponent. The search works fine when encoding is taking out.

        
    getSearchCondition(searchOptions) {
            var sheet = this.spread.getActiveSheet();
            $.fn.defaulSearchOptions = {
                rowStart: 0,
                columnStart: 0,
                rowEnd: sheet.getRowCount(),
                columnEnd: sheet.getColumnCount()
            };
    
            searchOptions = $.extend({}, $.fn.defaulSearchOptions, searchOptions);
            var searchCondition = new GC.Spread.Sheets.Search.SearchCondition();
       	searchCondition.searchString=encodeURIComponent(searchOptions.searchString);
            searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.zOrder;
            searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText;
            searchCondition.rowStart = searchOptions.rowStart;
            searchCondition.columnStart = searchOptions.columnStart;
            searchCondition.rowEnd = searchOptions.rowEnd;
            searchCondition.columnEnd = searchOptions.columnEnd;
            searchCondition.startSheetIndex = this.spread.getActiveSheetIndex();
            searchCondition.endSheetIndex = this.spread.getActiveSheetIndex();
            searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase | GC.Spread.Sheets.Search.SearchFlags.useWildCards;
            return searchCondition;
        }
    
    
  • Posted 25 March 2022, 1:57 am EST

    Hi Zhoubing,

    We tested out with the latest version of SpreadJS and it seems to be working fine at our end.

    Please refer to the following sample that I have created for you and let us know if we are missing any step in order to replicate the issue at our end: https://jscodemine.grapecity.com/share/4hhM3N3RSUu2gd1e_SgAIA/

    If the issue still persists for you, please share a working sample and the steps you have followed so that we can investigate it at our end and assist you accordingly. You can also modify the above sample and share with us.

    Regards

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels