您好,您的第一个问题可以通过给筛选器添加选项实现,例如:
- var compareType =
- GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo;
- var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(
- GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition,
- { compareType: compareType, expected: 1 }
- );
- var condition2 = new GC.Spread.Sheets.ConditionalFormatting.Condition(
- GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition,
- { compareType: compareType, expected: 2 }
- );
- var condition3 = new GC.Spread.Sheets.ConditionalFormatting.Condition(
- GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition,
- { compareType: compareType, expected: 3 }
- );
- var rowfilter = sheet.rowFilter();
- rowfilter.addFilterItem(0, condition1);
- rowfilter.addFilterItem(0, condition2);
- rowfilter.addFilterItem(0, condition3);
- rowfilter.filter(0);
复制代码
您的第二个问题,我们没有对应的API去操作这个筛选弹窗,实际上这个筛选弹窗是一个dom,您可以通过模拟点击来实现cancel点击效果:
- document.getElementById("gc-filterCancel").click()
复制代码 |