Get options object without overriding the filter functionality in Text Filters

Posted by: sharaththota.zem on 14 September 2022, 10:51 pm EST

  • Posted 14 September 2022, 10:51 pm EST

    Hi team!

    can i get options object without overriding the filter functionality. if i override the functionality i’m unable to filter the data . but i need both i.e get options object when we apply filter and also should filter the data in sheet.

    let old2 = GC.Spread.Sheets.Commands.filterByCondition.execute;

    GC.Spread.Sheets.Commands.filterByCondition.execute = function(spread,options){

    if(options.cmdOption.condition._ps.conType === GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition){

    console.log(“filterByCondition got called”,options);

    }

  • Posted 15 September 2022, 5:47 pm EST

    Hi,

    You may also use the RnageFiltering event. Please refer to the following code snippet and let me know if you face any issues.

    
    spread.bind(GC.Spread.Sheets.Events.RangeFiltering,(e,args)=>{console.log(args);
    let conInfo = args.conditionInfo;
    if(conInfo.conType ===GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition){
    console.log("filterByCondition got called",args);
    }
    })
    
    })
    
    

    RangeFiltering: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Events#rangefiltering

    regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels