-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] Actions Navigate #15902
Comments
Hey @aress31 ... the idea behind makes perfect sense. |
@michelengelen, let me give you this use case: const DataGridView = () => {
// --- SNIP ---
const modal = useModal();
const [refineCoreProps, setRefineCoreProps] = useState({ action: "create" });
const openModal = (action, id) => {
setRefineCoreProps({ action, id });
modal.show();
};
return (
<Box>
<DataGridComponent
columns={
loadingColumns || loadingData
? []
: createColumns(supabaseColumns, meta, openModal)
}
// --- SNIP ---
slotProps={{ toolbar: { openModal } }}
/>
<FormDialog
modalProps={{ modal, refineCoreProps }}
// --- SNIP ---
/>
</Box>
);
}; I have a |
OK, makes sense. I'll add this to the board for the team to have a look and estimate. |
Summary
Since hooks cannot be directly used within valueGetter or getActions, I suggest providing pre-built actions, such as navigation, opening modals, and more. This would enable a much broader range of use cases, such as integrating with React Router actions or parsing URL parameters to control modal visibility.
Currently, hooks need to be passed to the function that creates the columns. In complex applications where column creation occurs several levels above the components using them, this adds unnecessary complexity. Allowing the use of function callbacks or offering pre-built actions would simplify integration and enhance flexibility.
Examples
No response
Motivation
No response
Search keywords: datagrid, action, navigate
The text was updated successfully, but these errors were encountered: