0

I want specific rows to skip ag-grid's default filter function if they are having isDataBar property set to true.

I am using below gridOptions, but it's filtering out even the rows having isDataBar

      this.gridOptions = {
        doesExternalFilterPass: (node: RowNode) => {
          // Always pass rows with isDataBar: true
          if (node.data[this.skipExternalFilterOn]) {
            console.log(this.skipExternalFilterOn, 'Skip filter');
            return true;
          } else {
            console.log(this.skipExternalFilterOn, 'Apply filter');
          }

          // For other rows, let AG Grid's internal filters decide
          return true; // This allows internal filters to run
        },
        isExternalFilterPresent: () => {
          return true;
        },
      };

Sample Data

[{
    "id": 535,
    "snapshotId": null,
    "guid": "fbfa3109-bc69-4acb-9a2f-a85a9ac6c5bc",
    "submissionNumber": "Sub 1298",
    "policyNumber": "Pol 1337",
    "status": "SAVED",
    "policyId": 0,
    "insuredId": 399,
    "tagName": null,
    "lastChangedOn": "2025-08-28T09:49:46.2833333"
  },
  {
    "id": 533,
    "isDataBar": true,
    "snapshotId": null,
    "guid": "4475b13f-471b-4269-b2b5-df3827668b79",
    "submissionNumber": "SP-CH-011420-714902",
    "policyNumber": "SLSTPTY11268420",
    "status": "SAVED",
    "policyId": 0,
    "insuredId": 397,
    "tagName": null,
    "lastChangedOn": "2025-08-28T09:48:04.2433333"
  },
  {
    "id": 538,
    "snapshotId": null,
    "guid": "0EC6D3FD-1B7B-431A-AF82-54409AC92B19",
    "submissionNumber": "SCALE_RESULT_3",
    "policyNumber": "SCALE_RESULT_3",
    "status": "SAVED",
    "policyId": 0,
    "insuredId": 402,
    "tagName": null,
    "lastChangedOn": "2025-08-27T19:53:20.4"
  }]

What modification is required in the above code?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.