Grey out cell on a datagrid collection

Hey team,

On this Data Grid collection, I’d like to know if thanks to javascript, it would be possible to grey out some cells based on another cell (for instance in this image, hide cell budget column when “mode d’achat” is volume.

Thanks a lot for your help !

It might be possible with CSS, but it would be much easier to handle this in the Data Editor with an if-then-else column:

  • If mode d’achat is not Volume, then Budget

And then display the if-then-else column in the grid instead of the Budget column.

1 Like

Hey Darren,

Thanks for your answer - The fact is that the budget is an input from the user, I can’t use a if then column, I’d like to “fake a disable” using colored cells in the front. Does that make sense?

I don’t think you can have granular control like that on a row by row basis.

Would it be reasonable to have separate collections each filtered to there respective mode and disable editing in the Volume collection?

Other than that, my best guess would be to do something with CSS, but I usually don’t travel down that path, so I don’t have any immediate suggestions.

I think front-end JavaScript is the easiest way to deal with this, but unfortunately I don’t think Glide allows you to use JavaScript for the front-end.

1 Like

As an alternative to using the “Display as” configuration option aimed at the ITE column, you can create a message to the user not to edit it.

Hey Mate,

Do you mean like populate this message ? Would be interesting to pre-populate on row creation indeed but not sure if this is possible…

What I meant is to keep the input text column but you can use the “Display as” option to fetch the value from an if-then-else column (ITE). In the ITE column, you can create a rule such that when the value of the “mode d’achat” column is “volume,” it displays “Don’t edit,” else it displays “Budget.”

So, as long as the “mode d’achat” column has the text “volume,” the message you created in the ITE column will be automatically displayed in the input text column. This approach ensures that users see the appropriate message without needing to manually populate it each time.

Yes but the budget column is a input from user so I can’t create a ITE column for this… I really need to just prevent the user from entering information in this column

Your column functions can still be input by your users. The difference is that you only provide a different display via “Display as”.

Works fine thanks a lot :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.