FilterDropdown with null operator
In Antd table using NestJS-Query, how to do FilterDropdown with null operator?
2 Replies
Hi @chachi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, I don't have enough specific details to fully answer your question about implementing a FilterDropdown with a null operator in an Ant Design table using NestJS-Query. However, I can provide some relevant insights and suggestions based on similar issues with FilterDropdown and null values in refine:
1. The FilterDropdown component in refine doesn't currently support custom operators directly. This limitation has been noted in several issues, including this one (https://github.com/refinedev/refine/issues/1691).
2. For handling null values, there have been some challenges reported. In this issue (https://github.com/refinedev/refine/issues/3417), it was mentioned that searching for null values caused problems with the Strapi provider. The suggested workaround was to use an empty string instead of null.
3. Regarding NestJS specifically, there was an issue reported about the
nnull
operator not working correctly with the Nestjsx Crud provider. This was discussed in this GitHub issue (https://github.com/refinedev/refine/issues/4805). The refine team acknowledged that they hadn't mapped the nnul
operator and suggested it could be implemented if supported by nestjs-crud.
Given these limitations, you might need to consider alternative approaches:
1. You could use the setFilter
method from the useTable
hook to manually set the filter with the desired operator. This was suggested in a comment on this issue (https://github.com/refinedev/refine/issues/3417#issuecomment-1280449493).
2. Another approach could be to use the initialFilter
with an undefined value to set the operator, as mentioned in this comment (https://github.com/refinedev/refine/issues/1199#issuecomment-1021679417).
3. If you need more control over the filtering process, you might need to customize the useTable
hook or implement a custom filtering solution.
Remember that these suggestions are based on general issues with FilterDropdown and null values in refine, and may not perfectly align with your specific use case with NestJS-Query. If you need a more tailored solution, you might want to reach out to the refine community or consider opening a new issue on their GitHub repository.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@95552725294518272> Kapa.ai is still learning and improving, please let me know how I did by reacting below.