您好,了解您的需求了,根据您的需求,我想我们可以维护一个变量记录用户当前的top行,然后我们通过监听用户清除筛选的操作来将遮盖的行展示出来,示例代码如下,其中topRowIndex是一个全局变量
- topRowIndex = sheet.getViewportTopRow(1);
- sheet.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) {
- topRowIndex = args.newTopRow
- });
- spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, function (sender, args) {
- topRowIndex = args.newSheet.getViewportTopRow(1);
- args.oldSheet.unbind(GC.Spread.Sheets.Events.TopRowChanged);
- args.newSheet.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) {
- topRowIndex = args.newTopRow
- });
- });
- spread.commandManager().addListener("anyscLicenser", function () {
- for (const element of arguments) {
- let cmd = element.command;
- if (cmd.cmd === "Designer.clearRowFilter") {
- var as = spread.getActiveSheet();
- as.showRow(topRowIndex, GC.Spread.Sheets.VerticalPosition.top);
- }
- }
- });
复制代码
后续我们会对该需求进行讨论,本贴将被移动到需求反馈区
|
|