disable getOne or bypass getOne
Hello Refine team, I'm working on EditableTable, I understand when I click each row of table, the action is "Edit", since
- When action is "edit", it will be passed to the update and the getOne method from the dataProvider.it's pretty annoying it's making getOne call for each click, is it a way to disable getOne?
4 Replies
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: There is a way to disable the getOne method. SOURCES: ./docs/api-reference/antd/hooks/table/useEditableTable.md
Answer: There is a way to disable the getOne method. SOURCES: ./docs/api-reference/antd/hooks/table/useEditableTable.md
Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
extended-salmon•2y ago
Hello @Nehcob , unfortunately, it's not possible atm without side effect.
https://github.com/refinedev/refine/blob/next/packages/antd/src/hooks/table/useEditableTable/useEditableTable.ts#L62
you can pass
queryOptions: { enabled: false }
which will disable the query, but unfortunately, same props are passed to useTable as well, which will disable query for useTable too.
For now, you can copy this file and modify as you wish.
We'll consider accepting separate props to useEditableTable, formProps and tableProps, however, we won't deliver it quicklyGitHub
refine/useEditableTable.ts at next · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/useEditableTable.ts at next · refinedev/refine
future-harlequinOP•2y ago
oh, I need, good to know there is a way to disable the query, thanks btw! @batuhanw
extended-salmon•2y ago
Welcome @Nehcob , feel free to reach oout again if you have any issues!