appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.35k stars 3.72k forks source link

[Bug]: Updated Custom Column Name Not Reflected in the `sortOrder.column` Table Property #25492

Open ame-appsmith opened 1 year ago

ame-appsmith commented 1 year ago

Is there an existing issue for this?

Description

When sorting a table widget by a custom column that was renamed, the name does not get updated in the sortOrder.column property. image

Steps To Reproduce

  1. Add a Table widget to the canvas and bind it to a query.
  2. Add a Custom Column and rename it.
  3. Add a Text widget to the canvas and bind it to {{Table1.sortOrder.column}}.
  4. Sort the table by the custom column.
  5. Note that customColumn1 gets displayed in the Text widget instead of the updated name.

Public Sample App

No response

Environment

Production

Issue video log

No response

Version

v1.9.28

acreacico commented 1 year ago

We faced this issue, it's especially confusing when you have multiple custom fields and need te reference one of them.

somangshu commented 1 year ago

@acreacico can you please also help us understand what are you using this for. This will help us triage the problem better.

cc @sbalaji1192 I tried in a sample app, updating the accessor also does not affect the sortOrder object. Is this intentional?

sbalaji1192 commented 1 year ago

@somangshu We are using the column id when populating the sortOrder. For the source columns, it made sense since we will be using the column name from the source in the queries, not what is shown on the table.

dilippitchika commented 1 year ago

@acreacico a few questions

  1. Are you using server side sorting feature to sort data?
  2. If yes, what is the data being used in the custom column, is it coming from a different query?

Nevertheless this is a bug, and we should have shown the property name here. There's a workaround for this

Bumping this to medium

dilippitchika commented 1 year ago

I believe it's a small change which i think we can ask @gitstart-appsmith to make

ghost commented 1 year ago

We’d love to help you with it! Can you please assign the issue to us to create the ticket? Thank you :raised_hands:

acreacico commented 1 year ago

@acreacico a few questions

  1. Are you using server side sorting feature to sort data?
  2. If yes, what is the data being used in the custom column, is it coming from a different query?

Nevertheless this is a bug, and we should have shown the property name here. There's a workaround for this

  • Pass the same computed custom column directly in the source data

Bumping this to medium

This is exactly the workaround that we've used. Yes, there is a server side sorting. The data is coming from currentRow, not from a different query.