const subjectSheet = spread.getSheetFromName('科目筛选表')
const voucherSheet = spread.getSheetFromName('凭证筛选表')
if (subjectSheet !== null) {
// 设置冻结行列
subjectSheet.frozenColumnCount(6)
subjectSheet.frozenRowCount(1)
// 设置双击事件
subjectSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function(sender, args) {
if (args.col === 4 && args.row > 0) {
const portfolio = subjectSheet.getText(args.row, 14)
var columnCount = voucherSheet.getColumnCount()
var rowCount = voucherSheet.getRowCount()
var range = new GC.Spread.Sheets.Range(1, 0, rowCount - 1, columnCount - 1)
voucherSheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(range))
var compareType = GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo
var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, { compareType: compareType, expected: portfolio })
var rowfilter = voucherSheet.rowFilter()
rowfilter.addFilterItem(2, condition)
rowfilter.filter(2)
spread.setActiveSheet('凭证筛选表')
}
})
}
现在是voucherSheet 里面formulabar里会遗留之前的activeCell的值,重新双击筛选后,原值不显示,想清空 |