currentSourceRow leaves custom column values out in the cold

I'm adapting some legacy tables to the new table component to familiarize myself with it. We've got custom columns that do some footwork behind the scenes to display useful information. I'd like to be able to reference those custom column values when evaluating row Action disabled/hidden attributes (related post).

Alas, there doesn't seem to be any exposure of those custom column values that I can find, so the only option appears to be re-running the same footwork that calculates the custom column value in the first place, with a !! tacked on to squeeze a true/false out of it (or whatever). Very anti-DRY. The value I need is already right there, taunting me! I can see it, but I can't use it!

I scoured the "state" browser for my table, but could not find those custom column values anywhere (useful). table.data doesn't expose custom column values. Only table.selectedRow exposes the custom column values, but that's not at all helpful here. Is there something I'm missing? Perhaps this is in the pipeline already?

Should row-specific styling make its debut on the new table, I would likely want to access custom column values for that as well. Likely numerous use cases for it!

Hi @Schteevynn!

Thank you for this feedback. Not including currentRow in row action properties was a bit of an oversight, and we can definitely get that updated. I've filed a request internally, and we'll update this thread when it's available.

We are also actively looking into row-specific styling improvements for Table v2, hope to share more soon!

Best,
Alexi

1 Like

Thanks @Alexi , this is heartening to read. We will probably hold off on actually deploying the table-upgraded apps until after both this and the selectedRow-sync issue are resolved, rather than deploying with multiple workarounds in place.

Re: row-specific styling – FWIW, I think row text coloring would so, so sweet. IMO row text color > row background color!

Ahh. I have on and off noticed I was sometimes not getting the custom column reference but had not figured exactly when I was and wasn't seeing them.

Update: I've merged a fix for this and it will be live next week!

@shawncrocker yes, sorry it's a bit confusing! We're trying to differentiate between "source" rows (raw from the datasource) and the rows which include custom columns and mapped values. We expose selectedRow and selectedSourceRow on the Table component, and currentRow and currentSourceRow in Event handlers.

1 Like

@Alexi to be more specific, will currentRow be exposed for table Actions, too? I see I can use currentRow for table Event handlers as you mentioned, but, I can't use it for Actions. I should be able to refer to a calculated value in a custom column when disabling/hiding an Action on a row-by-row basis (rather than re-calculating that value all over again). Actions expose currentSourceRow, but the (calcuated) value I need isn't in there.

Yes! Apologies for the confusion. Mapped fields in row actions will now support currentRow and currentSourceRow. These changes will be live on cloud this week:

3 Likes

I've got currentRow working in new-table Action "Disabled" attribute, but it doesn't work in the new-table Action "Hidden" attribute. So, I can disable Actions on a row-by-row basis, but cannot hide Actions on a row-by-row basis. Is this intentional (to keep the number of buttons in all rows consistent)?


Screenshot 2023-06-29 at 2.00.06 PM

@Schteevynn correct! it's a better end-user experience for the number of row actions to be consistent. imagine scrolling vertically to trigger the same action on multiple rows, but suddenly the position of the desired action changes due to a different action being hidden for that specific row.

you can globally hide an action if, for example, the user doesn't have the permissions to trigger it, but we intentionally don't allow mapped evaluation in that field.

we do have a lot of planned improvements to row actions, including the ability to render some actions in an overflow dropdown. we may revisit this decision for overflow actions since the action position would remain static.

1 Like