snacpacc
snacpacc

Reputation: 13

<List filter= {....} > Or logic with List filters

Ive tried both

 <List {...props}
      filter={filter1 || filter2}
      filters={<ListFilter />}
      bulkActionButtons={<BulkActions canEdit={canEdit} />}
      perPage={preferences.rowsPerPage}
      pagination={<Pagination />} >
           <ListDesktop canEdit={canEdit} />
 </List>

and

 <List {...props}
      filter={filter1 %% filter2}
      filters={<ListFilter />}
      bulkActionButtons={<BulkActions canEdit={canEdit} />}
      perPage={preferences.rowsPerPage}
      pagination={<Pagination />} >
           <ListDesktop canEdit={canEdit} />
 </List>

Its very difficult to find any documentation on the filter property. Is there a way to accomplish or logic in react admin?

Upvotes: 0

Views: 90

Answers (1)

Carles Iglesias
Carles Iglesias

Reputation: 67

Hard to tell without more context.

Anyway filter is a prop so I assume filter1 and filter2 are objects. Assuming that I think you have to join in one single object, e.g. :

when filter1={id:1} and filter2={id:2} then filter={{id:[1,2]}}.

Hope this solves it.

Upvotes: 1

Related Questions