Selecting Cells (for Comment Thread)

I'm trying to select a specific cell in a table so I can add a comment thread to only that cell. It works (to a degree) when I use the {{ table.selectedCell.value }} option, but it will leave a comment on all cells where the value is the same. I need to index a specific cell by column and row, so that each individual cell is independent from the others. Is there a method for including multiple select statements in Thread ID?

Something like this, but with the right syntax:

Screenshot 2024-11-19 at 10.44.40 AM

Hi @abbieolson! The solution that you've provided here is definitely valid and should solve your problem, if I'm understanding correctly. Both sets of curly braces will evaluate separately and should output a value that will uniquely identify an individual cell, similar to what I've shown below:

image

Let me know if there's some nuance that I'm missing or if you have any additional questions!

Hi @Darren. Thanks for your help. You're right that the solution I'm providing works in selecting a unique cell, but I'm also trying to highlight a cell when someone leaves a comment on it. So, in your example, someone would leave a comment on the cell with "1email" in it. That cell would then be highlighted or marked in some way so an end user would know there's a comment on the cell. Can you help me figure out a way to do this? Thank you!

1 Like

Ah I think that might be a bit challenging for a few different reasons.

To start, the table component provides various utilities for selecting and styling individual rows, but doesn't do the the same for individual cells. I often recommend custom CSS as a workaround for certain styling issues, but there isn't an easy way to write the necessary selector rules.

The other challenge is twofold - "pushing" notifications out to end users and then keeping track of which users have seen those new comments. While certainly not what you have in mind, it would be significantly easier to display a list of the most recent comments.

There's probably a case to be made for adding the ability to select and style a cell via JS, at the very least! I'll talk to the team and simultaneously continue to think about potential solutions and workarounds. :thinking:

This would definitely be an awesome functionality to have. @MiguelOrtiz shared his workaround with me, but I was hoping to avoid adding a bespoke "comment" table to my database.

Glad to hear that you connected with Miguel! I'm going to go ahead and close this particular thread and move our conversation over to the one you've linked, as I think your original question here has been answered. :+1: