Search code examples
mui-x-data-grid

MUI Grid premium - filter operators


I'm looking for a full list of filter operators, because when I set up my filterModel as shown below I need to add a filter to show only row with plannedDate ON OR AFTER today, but I can't find the correct syntax.

<DataGridPremium
      columns={columns}
      rows={rows}
      getRowId={getRowId}
      slots={{
        toolbar: GridToolbar,
      }}
      density="compact"
      initialState={{
        filter: {
          filterModel: {
            items: [
              {
                field: "isActive",
                operator: "is",
                value: "true",
              },
              {
                field: "plannedDate",
                operator: "isOnOrAfter",
                value: "xx/xx/xxxx",
              },
            ],
          },
        },
      }}
/>

I've already checked this docs:


Solution

  • I didn't find any documentation regarding the full operators and filters, but I was able to retrive it by using the event onFilterModelChange

    onFilterModelChange={(model) => console.log(model)}
    

    The operator I was looking for is "onOrAfter" and the value required is a normal Date.