How to AddTextFilter to spread JS sheet in V10

Posted by: rajkumar.n1 on 9 April 2019, 4:21 pm EST

  • Posted 9 April 2019, 4:21 pm EST


    We have created Text filter to hide Invisible rows by using the below code

    var rowFilter = activeSheet.rowFilter();
    rowFilter.addTextFilter(0, GcSpread.Sheets.ComparisonOperator.EqualsTo, "Visible");

    How can we achieve this in V10 in Grapecity Spread JS
  • Replied 11 April 2019, 7:48 pm EST

    From spread.sheets version 10+, we set a filter using the addFilterItem() method. Please refer to the following code snippet:
    var activeSheet = spread.getActiveSheet();
    var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {
    compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,
    expected: "Visible"
    var rowFilter = activeSheet.rowFilter();
    rowFilter = new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0, 0, 7, 3));
    rowFilter.addFilterItem(1, condition);

    You may also refer to the following sample:

Need extra support?

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

Learn More

Forum Channels