Error when validating 'item' variable in the new tables

In self hosted 3.6.5 I'm trying to set the cell background with the following code
{{'rgb(' + (255 * item/20) + ',' + (255 - (255 * item/20)) + ',0)' }}

The colour is set as expected, but the parsing doesn't recognise that item is a valid reference:
Screenshot 2023-08-22 at 10.00.15

I see a similar issue with Event Handler
image

Again the code works in spite of the validation

Hey @DavidM, thanks for posting about this! Definitely a confusing experience. I believe the item linting error in the background field was a bug that was fixed in Cloud earlier this month, and in self-hosted version 3.8.1 (changelog note "Fixed an issue with code editor validation for color inputs in the Table component.") Some other threads related to that behavior:

Let me check into the event handler piece. Glad that as you mentioned, despite the error/red highlight in both cases, things functionally work :relieved:

@DavidM update for you on the event handler piece - when creating an Action, then an event handler on that action, I can reproduce that adding a hash param with the value {{currentRow.<your column name>}} will functionally work, but shows red and null in the UI. There's a bug report filed internally for this, and we'll let you know once that's resolved. Thanks for reporting!

Since it functionally works, no need to make any changes on your side, we'll just fix the linting error.

But in case this would work for your use case and you don't want to see the red in your editor UI, I wanted to also note another way to implement a similar thing: You can use selectedRow , like table1.selectedRow.<your table data column name> . Currently selectedRow won't throw the mistaken linting error. Either syntax shown below will technically work to append the hash:

1 Like

Hey @DavidM - closing the loop here, the action event handler linting error was fixed on v3.20! The current, fixed behavior:

Compared to the "before" behavior on 3.18:

Thanks, it's looking much better!

1 Like