I’d like to hide certain Datagrid columns in Tablet/Mobile view but keep them displayed in Desktop view. Is this possible please?
Yes!
There’s a display
property on each column. You can use a conditional statement like an if
formula or a switch
formula to say when you want to display or hide the column.
In the example below, we are saying that we only want to show the name column when the browser breakpoint has the “default” (i.e. desktop) value:
Does that help?
Here’s a short video on how the switch formula works if you’d like to look into it further but you could achieve the same with an if formula if you wanted to.
Awesome thanks @Joyce that is exactly what I was looking for.
Hey @Joyce the column is not hiding for me.
I added a similar condition which turns false on tablet mode, but the ‘Role’ column is still visible
Hi @Himanshu
Can you try without the quotes around true
and false
?
Right now, the machine is reading “true” and “false” as text because of the quotes but it needs to read the boolean values.
Oops. Worked now