Skip to content
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

[question] Is there a way to access the GridValidRowModel from the GridColDef 'type' parameter? #11981

Closed
wlee-vendelux opened this issue Feb 7, 2024 · 1 comment
Labels
support: commercial Support request from paid users

Comments

@wlee-vendelux
Copy link

wlee-vendelux commented Feb 7, 2024

The problem in depth

i have a GridColDef as below. I have no problem using valueGetter to set a custom value, but I also want to set the type property using a similar callback method. Is there any way to do this? I'm using the latest version of DataGrid

 const columns: GridColDef = {
      ...otherGridColDefProps
      editable: true,
      valueGetter: ({ row }) => {
        return row.custom_value[UUID].value
      },
      type: ({row}) => row.custom_value[UUID].type
    }

Your environment

No response

Search keywords: gridvalidrowmodel gridcoldef custom column type
Order ID: 69589

@wlee-vendelux wlee-vendelux added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Feb 7, 2024
@wlee-vendelux
Copy link
Author

omg im really dumb nevermind i found the solution.

and in case others discover this thread by accident wanting the same thing...

in my code the UUID was retrieved from a custom column object I created...which already had the type value associated with it. so I just did the following:

const columns: GridColDef = {
      ...otherGridColDefProps
      ...CustomColumn
      editable: true,
      valueGetter: ({ row }) => {
        return row.custom_value[CustomColumn.uuid].value
      },
      type: CustomColumn.type
    }

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

1 participant